Disable node on child when disabled on parent

This commit is contained in:
Kevin Sawicki 2016-03-23 17:36:26 -07:00
parent 777704e659
commit 463e077c3a

View file

@ -28,6 +28,11 @@ var mergeBrowserWindowOptions = function (embedder, options) {
if (embedder.browserWindowOptions != null) { if (embedder.browserWindowOptions != null) {
// Inherit the original options if it is a BrowserWindow. // Inherit the original options if it is a BrowserWindow.
mergeOptions(options, embedder.browserWindowOptions) mergeOptions(options, embedder.browserWindowOptions)
// Disable node integration on child window if disabled on parent window
if (!embedder.browserWindowOptions.webPreferences.nodeIntegration) {
options.webPreferences.nodeIntegration = false
}
} else { } else {
// Or only inherit web-preferences if it is a webview. // Or only inherit web-preferences if it is a webview.
if (options.webPreferences == null) { if (options.webPreferences == null) {