|
@@ -48,11 +48,16 @@ const mergeBrowserWindowOptions = function (embedder, options) {
|
|
|
options.webPreferences.nodeIntegration = false
|
|
|
}
|
|
|
|
|
|
- // Enable context isolation on child window if enable on parent window
|
|
|
+ // Enable context isolation on child window if enabled on parent window
|
|
|
if (embedder.getWebPreferences().contextIsolation === true) {
|
|
|
options.webPreferences.contextIsolation = true
|
|
|
}
|
|
|
|
|
|
+ // Disable JavaScript on child window if disabled on parent window
|
|
|
+ if (embedder.getWebPreferences().javascript === false) {
|
|
|
+ options.webPreferences.javascript = false
|
|
|
+ }
|
|
|
+
|
|
|
// Sets correct openerId here to give correct options to 'new-window' event handler
|
|
|
options.webPreferences.openerId = embedder.id
|
|
|
|
|
@@ -186,7 +191,7 @@ ipcMain.on('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_OPEN', (event, url, frameName,
|
|
|
const options = {}
|
|
|
|
|
|
const ints = ['x', 'y', 'width', 'height', 'minWidth', 'maxWidth', 'minHeight', 'maxHeight', 'zoomFactor']
|
|
|
- const webPreferences = ['zoomFactor', 'nodeIntegration', 'preload']
|
|
|
+ const webPreferences = ['zoomFactor', 'nodeIntegration', 'preload', 'javascript', 'contextIsolation']
|
|
|
const disposition = 'new-window'
|
|
|
|
|
|
// Used to store additional features
|