Skip to content

fix: read nodeIntegrationInWorker from per-frame WebPreferences#50163

Merged
VerteDinde merged 2 commits into38-x-yfrom
mb-38-node-worker
Mar 10, 2026
Merged

fix: read nodeIntegrationInWorker from per-frame WebPreferences#50163
VerteDinde merged 2 commits into38-x-yfrom
mb-38-node-worker

Conversation

@VerteDinde
Copy link
Copy Markdown
Member

Manual backport of #50122

See that PR for details

Notes: none

MarshallOfSound and others added 2 commits March 9, 2026 11:46
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 requested a review from a team as a code owner March 9, 2026 18:55
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Mar 9, 2026
@trop trop bot requested a review from a team March 9, 2026 18:55
@trop trop bot added 38-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Mar 9, 2026
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Mar 9, 2026
@VerteDinde VerteDinde enabled auto-merge (squash) March 9, 2026 22:55
@VerteDinde VerteDinde merged commit e17eef4 into 38-x-y Mar 10, 2026
113 of 115 checks passed
@VerteDinde VerteDinde deleted the mb-38-node-worker branch March 10, 2026 05:02
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Mar 10, 2026

No Release Notes

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

Labels

38-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.

3 participants