diff --git a/src/main/views/webContentEvents.ts b/src/main/views/webContentEvents.ts index e7c808a5..61d0473b 100644 --- a/src/main/views/webContentEvents.ts +++ b/src/main/views/webContentEvents.ts @@ -199,27 +199,26 @@ export class WebContentsEventManager { } }); this.popupWindow.webContents.setWindowOpenHandler(this.denyNewWindow); - this.popupWindow.once('ready-to-show', () => { - this.popupWindow!.show(); - }); this.popupWindow.once('closed', () => { this.popupWindow = undefined; }); + const contextMenu = new ContextMenu({}, this.popupWindow); + contextMenu.reload(); } + const popupWindow = this.popupWindow; + popupWindow.once('ready-to-show', () => popupWindow.show()); + if (urlUtils.isManagedResource(serverURL, parsedURL)) { - this.popupWindow.loadURL(details.url); + popupWindow.loadURL(details.url); } else { // currently changing the userAgent for popup windows to allow plugins to go through google's oAuth // should be removed once a proper oAuth2 implementation is setup. - this.popupWindow.loadURL(details.url, { + popupWindow.loadURL(details.url, { userAgent: composeUserAgent(), }); } - const contextMenu = new ContextMenu({}, this.popupWindow); - contextMenu.reload(); - return {action: 'deny'}; }