From 553021bc9ca04dc612c1d5aabf4b25d759d4fa3a Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 10 Jul 2017 15:44:07 -0700 Subject: [PATCH] Only assign opener when not using nativeWindowOpen --- lib/renderer/window-setup.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/renderer/window-setup.js b/lib/renderer/window-setup.js index 31767a290d4d..b94eace5aeca 100644 --- a/lib/renderer/window-setup.js +++ b/lib/renderer/window-setup.js @@ -127,6 +127,10 @@ module.exports = (ipcRenderer, guestInstanceId, openerId, hiddenPage, usesNative return null } } + + if (openerId != null) { + window.opener = getOrCreateProxy(ipcRenderer, openerId) + } } window.alert = function (message, title) { @@ -142,10 +146,6 @@ module.exports = (ipcRenderer, guestInstanceId, openerId, hiddenPage, usesNative throw new Error('prompt() is and will not be supported.') } - if (openerId != null) { - window.opener = getOrCreateProxy(ipcRenderer, openerId) - } - ipcRenderer.on('ELECTRON_GUEST_WINDOW_POSTMESSAGE', function (event, sourceId, message, sourceOrigin) { // Manually dispatch event instead of using postMessage because we also need to // set event.source.