From eafe9c245b6b8c74fb1e49b0a458f546696176d3 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 30 Mar 2016 10:51:56 -0700 Subject: [PATCH] Disable guest node integration when embedder has it disabled --- lib/browser/guest-window-manager.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/browser/guest-window-manager.js b/lib/browser/guest-window-manager.js index 5782670ac639..7508b6f16a2e 100644 --- a/lib/browser/guest-window-manager.js +++ b/lib/browser/guest-window-manager.js @@ -28,11 +28,6 @@ var mergeBrowserWindowOptions = function (embedder, options) { if (embedder.browserWindowOptions != null) { // Inherit the original options if it is a BrowserWindow. mergeOptions(options, embedder.browserWindowOptions) - - // Disable node integration on child window if disabled on parent window - if (embedder.getWebPreferences().nodeIntegration === false) { - options.webPreferences.nodeIntegration = false - } } else { // Or only inherit web-preferences if it is a webview. if (options.webPreferences == null) { @@ -40,6 +35,12 @@ var mergeBrowserWindowOptions = function (embedder, options) { } mergeOptions(options.webPreferences, embedder.getWebPreferences()) } + + // Disable node integration on child window if disabled on parent window + if (embedder.getWebPreferences().nodeIntegration === false) { + options.webPreferences.nodeIntegration = false + } + return options }