Skip to content

window.open with nativeWindowOpen option always enables nodeIntegration even set it to false #15666

Closed

Description

@KochiyaOcean
  • Output of node_modules/.bin/electron --version: 4.0.0-beta.7
  • Operating System (Platform and Version): Windows 10 1803 x64
  • Output of node_modules/.bin/electron --version on last known working Electron version (if applicable): no

Expected Behavior
A window opened with nativeWindowOpen option should disables nodeIntegration if it's set to false

Actual behavior
nodeIntegration is still enabled

To Reproduce

  • Open a BrowserWindow with nativeWindowOpen option
  • Run open('', '', 'nodeIntegration=no')
  • There will be a deprecated warning about memory leak of nodeIntegration, and window.require is still available in the window opened.

Screenshots
image

Additional Information
The nodeIntegration option of parent window is set to true

Activity

  1. zcbenz commented on Nov 16, 2018

    @zcbenz
    Contributor

    This is a side effect since the introduction of the nativeWindowOpen option, and unfortunately we don't have a way to fix it because in Chromium it assumes native child windows must share exactly same web preferences with the parent window.

    I'm going to make this behavior explicitly documented and close this as won't fix.

    Since 5.x, child windows with nativeWindowOpen will always have node integration disabled.

  2. jkleinsc commented on Nov 19, 2018

    @jkleinsc
    Member

    Closed via #15751

  3. pushkin- commented on Dec 3, 2018

    @pushkin-

    @zcbenz What is "5.x" in your comment? Are you saying that Electron 5.0+ will have node integration disabled if nativeWindowOpen is used, but for right now, it will inherit the parent view's nodeintegration?

  4. mehrshadFarzaneh commented on Sep 24, 2021

    @mehrshadFarzaneh

    webPreferences: {
    nodeIntegration: true,
    contextIsolation: false,
    nativeWindowOpen:true
    }

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions