Skip to content

fix(chromium): insert oopifs into the frame hierarchy when connecting over CDP#37359

Merged
dgozman merged 1 commit into
microsoft:mainfrom
dgozman:fix-cr-cdp-oopifs
Sep 10, 2025
Merged

fix(chromium): insert oopifs into the frame hierarchy when connecting over CDP#37359
dgozman merged 1 commit into
microsoft:mainfrom
dgozman:fix-cr-cdp-oopifs

Conversation

@dgozman

@dgozman dgozman commented Sep 9, 2025

Copy link
Copy Markdown
Collaborator

Previously, the information of the parent frame for an OOPIF target was not available over CDP. With the latest Chromium, we can finally determine where does the OOPIF fit in the frame hierarchy.

Fixes #17656.

… over CDP

Previously, the information of the parent frame for an OOPIF target
was not available over CDP. With the latest Chromium, we can finally
determine where does the OOPIF fit in the frame hierarchy.
@github-actions

github-actions Bot commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

4 flaky ⚠️ [chromium-library] › library/chromium/oopif.spec.ts:284 › should click `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1079 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node18`
⚠️ [firefox-page] › page/page-event-request.spec.ts:182 › should return response body when Cross-Origin-Opener-Policy is set `@firefox-ubuntu-22.04-node18`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:429 › should filter actions tab on double-click `@ubuntu-latest-node18-1`

46774 passed, 821 skipped


Merge workflow run.

@dgozman dgozman requested a review from yury-s September 9, 2025 19:55

private _addBrowserListeners() {
this._eventListeners.push(...[
eventsHelper.addEventListener(this._client, 'Target.attachedToTarget', event => this._onAttachedToTarget(event)),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this compatible with chromium <141 ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these events were always coming from the browser.

if (!frame && event.targetInfo.parentFrameId) {
// When connecting to an existing page with an iframe, there is an "iframe" target,
// but no local frame is reported in getFrameTree. We can create a remote frame here.
frame = this._page.frameManager.frameAttached(targetId, event.targetInfo.parentFrameId);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be that the parent frame has not been reported yet/has been removed already at this point?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Targets come from the browser target and the source of truth. If the frame is removed, we'll get Target.detachedFromTarget shortly after.

@dgozman dgozman merged commit ca0e7c8 into microsoft:main Sep 10, 2025
35 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]when using connect_over_cdp, the browser_context.pages returned pages missing child_frames

2 participants