Skip to content

fix(webkit): do not report blob: URLs to route handlers - #42738

Open
Mohan Ram (mohanram-dev) wants to merge 1 commit into
microsoft:mainfrom
mohanram-dev:fix/webkit-ignore-blob-urls
Open

Mohan Ram (mohanram-dev) wants to merge 1 commit into
microsoft:mainfrom
mohanram-dev:fix/webkit-ignore-blob-urls

Conversation

@mohanram-dev

Copy link
Copy Markdown

Fixes #42727.

Description

In WebKit, blob: URLs were being dispatched to page.route handlers, whereas Chromium and Firefox do not dispatch network interception for blob: URLs.

In wkPage.ts and wvPage.ts, _onRequestWillBeSent already filters out data: and about: URLs, but did not exclude blob: URLs. When event.request.url.startsWith('blob:') is skipped in _onRequestWillBeSent, any subsequent requestIntercepted event continues cleanly without invoking route handlers or page.on('request').

Changes

  • In packages/playwright-core/src/server/webkit/wkPage.ts: return early in _onRequestWillBeSent if event.request.url.startsWith('blob:').
  • In packages/playwright-core/src/server/webkit/webview/wvPage.ts: return early in _onRequestWillBeSent if event.request.url.startsWith('blob:').
  • In tests/page/page-route.spec.ts: add regression test validating that blob: URLs from web workers and fetch() are not reported to route handlers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: WebKit reports blob: URLs to page.route handlers; Chromium and Firefox do not

1 participant