[GH-2534] Refocus the popup window if already exists (#2581)
* [GH-2534] Refocus the popup window if already exists * PR feedback --------- Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
@@ -199,27 +199,26 @@ export class WebContentsEventManager {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.popupWindow.webContents.setWindowOpenHandler(this.denyNewWindow);
|
this.popupWindow.webContents.setWindowOpenHandler(this.denyNewWindow);
|
||||||
this.popupWindow.once('ready-to-show', () => {
|
|
||||||
this.popupWindow!.show();
|
|
||||||
});
|
|
||||||
this.popupWindow.once('closed', () => {
|
this.popupWindow.once('closed', () => {
|
||||||
this.popupWindow = undefined;
|
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)) {
|
if (urlUtils.isManagedResource(serverURL, parsedURL)) {
|
||||||
this.popupWindow.loadURL(details.url);
|
popupWindow.loadURL(details.url);
|
||||||
} else {
|
} else {
|
||||||
// currently changing the userAgent for popup windows to allow plugins to go through google's oAuth
|
// 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.
|
// should be removed once a proper oAuth2 implementation is setup.
|
||||||
this.popupWindow.loadURL(details.url, {
|
popupWindow.loadURL(details.url, {
|
||||||
userAgent: composeUserAgent(),
|
userAgent: composeUserAgent(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const contextMenu = new ContextMenu({}, this.popupWindow);
|
|
||||||
contextMenu.reload();
|
|
||||||
|
|
||||||
return {action: 'deny'};
|
return {action: 'deny'};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user