mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
ELECTRON-1050: fix issue where we were opening new window for same pod url (#577)
This commit is contained in:
parent
ae508da377
commit
b40c2787bf
@ -454,7 +454,17 @@ function doCreateMainWindow(initialUrl, initialBounds, isCustomTitleBar) {
|
||||
let emptyUrlString = 'about:blank';
|
||||
let dispositionWhitelist = ['new-window', 'foreground-tab'];
|
||||
|
||||
// only allow window.open to succeed is if coming from same hsot,
|
||||
let fullMainUrl = `${mainWinParsedUrl.protocol}//${mainWinParsedUrl.host}/`;
|
||||
|
||||
// If the main url and new window url are the same,
|
||||
// we open that in a browser rather than a separate window
|
||||
if (newWinUrl === fullMainUrl) {
|
||||
event.preventDefault();
|
||||
openUrlInDefaultBrowser(newWinUrl);
|
||||
return;
|
||||
}
|
||||
|
||||
// only allow window.open to succeed is if coming from same host,
|
||||
// otherwise open in default browser.
|
||||
if ((newWinHost === mainWinHost || newWinUrl === emptyUrlString) && dispositionWhitelist.includes(disposition)) {
|
||||
// handle: window.open
|
||||
|
Loading…
Reference in New Issue
Block a user