Skip to content

fix(webview): intercept subframe document requests before frame is known#41332

Open
yury-s wants to merge 2 commits into
microsoft:mainfrom
yury-s:fix-webview-subframe-interception
Open

fix(webview): intercept subframe document requests before frame is known#41332
yury-s wants to merge 2 commits into
microsoft:mainfrom
yury-s:fix-webview-subframe-interception

Conversation

@yury-s

@yury-s yury-s commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Stock WebKit RDP has no Page.frameAttached, so a subframe's document request arrives before Page.frameNavigated creates its frame. The request was dropped, which stalled intercepted subframe loads (the route handler never ran).
  • Let such a request through frameless: frameManager.requestStarted (and the inflight helpers / requestFailed) now tolerate a null frame and skip the per-frame bookkeeping, so the route still fulfills/continues it. The frame is created normally once Page.frameNavigated arrives.

@yury-s yury-s requested review from dcrousso and dgozman June 16, 2026 23:52
@github-actions

This comment has been minimized.

Stock WebKit RDP has no Page.frameAttached, so a subframe's document request
arrives before Page.frameNavigated creates its frame. The request was dropped,
which stalled intercepted subframe loads (the route handler never ran).

Let such a request through frameless: requestStarted (and the inflight helpers /
requestFailed) now tolerate a null frame and skip the per-frame bookkeeping, so
the route still fulfills/continues it. The frame is created normally once
Page.frameNavigated arrives.
@yury-s yury-s force-pushed the fix-webview-subframe-interception branch from 4f739f2 to 6018b71 Compare June 17, 2026 00:29
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Intercepting subframe document requests lets the selectors-frame / locator-frame
route-based tests load their iframes, so unskip the 26 that now pass.

Still skipped: the smoke/nested/$ variants that fulfill the main navigation
(flaky iOS 26 main-nav interception), the COEP/COOP/CORP isolated iframe
(out-of-process), and locator.contentFrame / frameLocator.owner.
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

7354 passed, 1122 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

Warning

The triggering workflow run ended with status cancelled. Results below may be incomplete — blob reports from cancelled or timed-out shards are missing, so passing/failing counts do not reflect the full test suite.

4 flaky ⚠️ [chromium-library] › library/chromium/chromium.spec.ts:177 › serviceWorker(), and fromServiceWorker() work `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-page] › page/page-request-continue.spec.ts:756 › propagate headers cross origin redirect after interception `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/popup.spec.ts:260 › should not throw when click closes popup `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/video.spec.ts:645 › screencast › should capture full viewport `@chromium-ubuntu-22.04-node20`

39544 passed, 739 skipped


Merge workflow run.

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.

2 participants