Skip to content

fix: read nodeIntegrationInWorker from per-frame WebPreferences (#50122)#50467

Merged
VerteDinde merged 2 commits into40-x-yfrom
backport/40-x-y/50122
Mar 24, 2026
Merged

fix: read nodeIntegrationInWorker from per-frame WebPreferences (#50122)#50467
VerteDinde merged 2 commits into40-x-yfrom
backport/40-x-y/50122

Conversation

@VerteDinde
Copy link
Copy Markdown
Member

Backport of #50122.

Patch adaptation: updated dedicated_worker.cc index hashes for Chromium 144.0.7559.236.

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

@VerteDinde VerteDinde requested a review from a team as a code owner March 24, 2026 20:36
@VerteDinde VerteDinde added the semver/patch backwards-compatible bug fixes label Mar 24, 2026
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Mar 24, 2026
@trop trop bot requested a review from a team March 24, 2026 20:36
@trop trop bot added 40-x-y backport This is a backport PR labels Mar 24, 2026
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Mar 24, 2026
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.
@VerteDinde VerteDinde force-pushed the backport/40-x-y/50122 branch from bd93419 to f2ac5c8 Compare March 24, 2026 20:39
@VerteDinde VerteDinde enabled auto-merge (squash) March 24, 2026 21:01
…apHandler

The backported PR removed this include (matching main where
SetUpWebAssemblyTrapHandler was refactored), but on 40-x-y the function
still uses base::CommandLine.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@VerteDinde VerteDinde merged commit 2871c1d into 40-x-y Mar 24, 2026
58 of 59 checks passed
@VerteDinde VerteDinde deleted the backport/40-x-y/50122 branch March 24, 2026 22:48
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Mar 24, 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

40-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