-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Hello,
I would like to ask you about implementation abort function so we can skip some resources to load, especially in my case images and videos.
I made this function here:
https://github.com/geometerio/playwright-elixir/blob/ab729b6f6f1f4f6d9e238d5e97598757b968c548/lib/playwright/route.ex#L14-L15
@spec abort(t(), binary()) :: :ok
defp abort(%Route{session: session} = route, error_code \\ nil) do
Channel.post(session, {:guid, route.guid}, :abort, %{error_ode: error_code})
endand implementation:
Playwright.Page.route(page_loader, "**/*", fn route, request ->
if request.resource_type in ["image", "font"] do
Playwright.Route.abort(route, "blockedbyclient")
else
Playwright.Route.continue(route)
end
end)But it crash server, I very new in playwright so not sure where can be problem.
Metadata
Metadata
Assignees
Labels
No labels