Skip to content

fix(chromium): bypass service workers on the storage state page - #42664

Merged
Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
lazerg:fix-42656
Sep 14, 2026
Merged

Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
lazerg:fix-42656

Conversation

@lazerg

Copy link
Copy Markdown
Contributor

Summary

  • storageState() visits each origin with an internal page that fulfills every request with an empty document, but in Chromium a service worker serves the navigation before request interception can, so the site's own scripts run during the capture and a redirect from them aborts it.
  • The internal page now sends Network.setBypassServiceWorker, so its navigations reach the interceptor.

Fixes #42656

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

1 failed
❌ [firefox-library] › library/browsercontext-storage-state.spec.ts:453 › should work when service worker is intefering and the origin is not open @firefox-ubuntu-22.04-node20

6 flaky ⚠️ [chromium-library] › library/video.spec.ts:356 › screencast › should work for popups `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/page-close.spec.ts:200 › should not throw when continuing while page is closing `@chromium-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-page] › page/page-event-request.spec.ts:181 › should return response body when Cross-Origin-Opener-Policy is set `@firefox-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:827 › should update state on subsequent run `@windows-latest-node22`

51673 passed, 1247 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [chrome] › mcp/annotate.spec.ts:446 › should switch screencast to -s session on show --annotate @mcp-windows-latest-chrome

8347 passed, 1376 skipped


Merge workflow run.

@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit 654654f into microsoft:main Sep 14, 2026
43 of 45 checks passed
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]: browserContext.storageState() runs third-party page JS and can fail when a visited origin has a service worker

2 participants