Sets correct openerId in mergeBrowserWindowOptions() to give correct options to 'new-window' event handler

This commit is contained in:
Michael Vasseur 2016-09-29 15:43:40 +02:00
parent cc7f4fedf6
commit a2b3cf95a7

View file

@ -40,6 +40,9 @@ const mergeBrowserWindowOptions = function (embedder, options) {
options.webPreferences.nodeIntegration = false options.webPreferences.nodeIntegration = false
} }
// Sets correct openerId here to give correct options to 'new-window' event handler
options.webPreferences.openerId = embedder.id
return options return options
} }
@ -93,7 +96,7 @@ const createGuest = function (embedder, url, frameName, options) {
if (options.webPreferences == null) { if (options.webPreferences == null) {
options.webPreferences = {} options.webPreferences = {}
} }
options.webPreferences.openerId = embedder.id
guest = new BrowserWindow(options) guest = new BrowserWindow(options)
if (!options.webContents || url !== 'about:blank') { if (!options.webContents || url !== 'about:blank') {
// We should not call `loadURL` if the window was constructed from an // We should not call `loadURL` if the window was constructed from an