Skip to content

fix: read nodeIntegrationInWorker from per-frame WebPreferences#50134

Merged
VerteDinde merged 2 commits into41-x-yfrom
trop/41-x-y-bp-fix-read-nodeintegrationinworker-from-per-frame-webpreferences-1773042611421
Mar 9, 2026
Merged

fix: read nodeIntegrationInWorker from per-frame WebPreferences#50134
VerteDinde merged 2 commits into41-x-yfrom
trop/41-x-y-bp-fix-read-nodeintegrationinworker-from-per-frame-webpreferences-1773042611421

Conversation

@trop
Copy link
Copy Markdown
Contributor

@trop trop bot commented Mar 9, 2026

Backport of #50122

See that PR for details.

Notes: Fixed an issue where nodeIntegrationInWorker overrides in setWindowOpenHandler were not honored for child windows sharing a renderer process with their opener.

Previously the renderer checked a process-wide command-line switch to
decide whether to create a Node.js environment for dedicated workers.
When a renderer process hosted multiple WebContents with different
nodeIntegrationInWorker values (e.g. via window.open with overridden
webPreferences in setWindowOpenHandler), all workers in the process
used whichever value the first WebContents set on the command line.

Instead, plumb the flag through blink's WorkerSettings at worker
creation time, copying it from the initiating frame's WebPreferences.
The check on the worker thread then reads the per-worker value. Nested
workers inherit the flag from their parent worker via
WorkerSettings::Copy.

The --node-integration-in-worker command-line switch is removed as it
is no longer consumed.

Co-authored-by: Samuel Attard <sattard@anthropic.com>
@trop trop bot requested a review from a team as a code owner March 9, 2026 07:50
@trop trop bot requested review from a team and MarshallOfSound March 9, 2026 07:50
@trop trop bot added 41-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Mar 9, 2026
@VerteDinde VerteDinde enabled auto-merge (squash) March 9, 2026 22:59
@VerteDinde VerteDinde merged commit a14f661 into 41-x-y Mar 9, 2026
57 checks passed
@VerteDinde VerteDinde deleted the trop/41-x-y-bp-fix-read-nodeintegrationinworker-from-per-frame-webpreferences-1773042611421 branch March 9, 2026 23:26
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Mar 9, 2026

Release Notes Persisted

Fixed an issue where nodeIntegrationInWorker overrides in setWindowOpenHandler were not honored for child windows sharing a renderer process with their opener.

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants