MarshallOfSound

#50122: fix: read nodeIntegrationInWorker from per-frame WebPreferences

Merged
Created: Mar 8, 2026, 1:36:42 AM
Merged: Mar 9, 2026, 2:50:02 AM
6 comments
Target: main

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 hosts 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 — the override had no effect.

This plumbs 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.

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

Backports

38-x-y
Merged
PR Number
#50163
Merged At
Mar 10, 2026, 12:02:19 AM
Released In
Not yet
Release Date
Not yet
39-x-y
Pending
Waiting for a manual backport
40-x-y
Pending
Waiting for a manual backport
41-x-y
Merged
PR Number
#50134
Merged At
Mar 9, 2026, 6:26:10 PM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron