Skip to content

fix: renderer crash after IPC to a window.open() child with its own contextIsolation - #53538

Merged
MarshallOfSound merged 1 commit into
45-x-yfrom
trop/45-x-y-bp-fix-renderer-crash-after-ipc-to-a-window-open-child-with-its-own-contextisolation-1788547894098
Sep 4, 2026
Merged

MarshallOfSound merged 1 commit into
45-x-yfrom
trop/45-x-y-bp-fix-renderer-crash-after-ipc-to-a-window-open-child-with-its-own-contextisolation-1788547894098

Conversation

@trop

@trop trop Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Backport of #53535

See that PR for details.

Notes: Fixed a renderer crash when the main process sent IPC to, or a page navigated, a same-process window.open() child whose contextIsolation differed from its opener's.

…ontextIsolation

A window.open() child of an opener with contextIsolation: false gets
contextIsolation: true unless the handler overrides it, but its synchronous
about:blank document starts with the opener's WebPreferences. Its Node.js
environment is therefore created in the main world. Once the browser sends
the child's own preferences, the observer and GetContext() pick the isolated
world instead, so the first IPC message to the child created a context there
and hit CHECK(!environments_.contains(render_frame)). Navigating such a child
skipped the release of its environment for the same reason.

Record the world of each frame's environment when it is created. While the
environment exists, only that world is notified of context creation and
release, and GetContext() returns the environment's context, so IPC reaches
the preload that ran in it.

Co-authored-by: Sam Attard <[email protected]>
@trop
trop Bot requested a review from MarshallOfSound September 4, 2026 18:52
@trop trop Bot added 45-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Sep 4, 2026
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) September 4, 2026 19:33
@MarshallOfSound MarshallOfSound self-assigned this Sep 4, 2026
@MarshallOfSound
MarshallOfSound merged commit 44dbdda into 45-x-y Sep 4, 2026
95 checks passed
@MarshallOfSound
MarshallOfSound deleted the trop/45-x-y-bp-fix-renderer-crash-after-ipc-to-a-window-open-child-with-its-own-contextisolation-1788547894098 branch September 4, 2026 20:01
@release-clerk

release-clerk Bot commented Sep 4, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed a renderer crash when the main process sent IPC to, or a page navigated, a same-process window.open() child whose contextIsolation differed from its opener's.

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

Labels

45-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant