Skip to content

[Bug]: nodeIntegration cannot be disabled via window.open() with nativeWindowOpen #31949

@miniak

Description

@miniak

Preflight Checklist

Electron Version

16.0.1

What operating system are you using?

macOS

Operating System Version

macOS Catalina 10.15.7

What arch are you using?

x64

Last Known Working Electron version

N/A

Expected Behavior

I have a BrowserWindow with nativeWindowOpen enabled and nodeIntegration enabled. I want to open a popup using window.open('popup.html', '', 'nodeIntegration=no');, to have nodeIntegration disabled. This is documented here:

A subset of `WebPreferences` can be set directly,
unnested, from the features string: `zoomFactor`, `nodeIntegration`, `preload`,
`javascript`, `contextIsolation`, and `webviewTag`.

Actual Behavior

The popup window has nodeIntegration enabled incorrectly. However, when the parent window has nativeWindowOpen disabled, it works.

Testcase Gist URL

No response

Additional Information

native-window-open-node-integration.zip

Test passed: Electron exited with code 0.
Test failed: Electron exited with code 1.

This issue is blocking #29405

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions