Conversation
… the Playwright protocol and make it configurable via playwright.ignore.https.errors (default false).
…laywright browser.
dpol1
left a comment
There was a problem hiding this comment.
the URI parsing breaks with the default exclude list and the docs promise more than the handler sees, see inline
| } | ||
| final URI uri; | ||
| try { | ||
| uri = new URI(url); |
There was a problem hiding this comment.
new URI fails on |, [, ] (and { } ^ in a query), which Chromium sends as is, and gives no host for a name with _: with the default exclude list those get aborted as forbidden. HttpUrl.parse takes them all, and a test with one of them?
| # to the target, so only its address is known here and a proxy on a private | ||
| # address is fine. The proxy's own egress rules decide what it may reach. | ||
| # Applies to the okhttp and playwright protocols. Playwright checks each | ||
| # request of the browser (page, redirects, subresources) against an address |
There was a problem hiding this comment.
redirect hops never go through the handler, only the first url does (the note above page.route says it, and a 302 on an image and on the main page confirmed it), so this should list redirects with websockets as not checked. same block still says okhttp only, and the adoc line on failing with an IOException doesn't hold for a blocked subresource.
| } else if (resourceTypesToSkip.contains( | ||
| route.request().resourceType())) { | ||
| route.abort(); | ||
| } else if (!isAllowedAddress(route.request().url())) { |
There was a problem hiding this comment.
the handler also misses what a service worker fetches (playwright suggests setServiceWorkers(BLOCK) when routing) and popups, which open unblocked with no handler at all unless the route sits on the context. block them or document them, your call
Fixes #2095. Depends on #2158 (stacked; review only the last commit until #2158 is merged).
The existing route handler now checks each browser request (page, redirects, subresources) against
http.filter.ipaddress.*and aborts rejected ones. Not applied throughhttp.proxy, same as OkHttp. The address is resolved separately from the browser and WebSockets are not checked; both limits are documented.URL filters are not applied here: main page redirects are already aborted and go through the regular pipeline, and crawl-scope filters on subresources would break rendering.
Release note: with the default exclude list, Playwright topologies crawling loopback or private addresses need to override
http.filter.ipaddress.exclude.