Enable context isolation on child windows

This commit is contained in:
Kevin Sawicki 2017-01-10 09:37:38 -08:00
parent eef72647b4
commit 95054f443f
2 changed files with 14 additions and 0 deletions

View file

@ -47,6 +47,11 @@ const mergeBrowserWindowOptions = function (embedder, options) {
options.webPreferences.nodeIntegration = false
}
// Enable context isolation on child window if enable on parent window
if (embedder.getWebPreferences().contextIsolation === true) {
options.webPreferences.contextIsolation = true
}
// Sets correct openerId here to give correct options to 'new-window' event handler
options.webPreferences.openerId = embedder.id