mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-01-03 12:47:13 -06:00
Merge pull request #309 from VishwasShashidhar/ELECTRON-274
ELECTRON-274: fix issue for diagnostics link
This commit is contained in:
commit
d7dbaf051f
@ -311,7 +311,7 @@ function doCreateMainWindow(initialUrl, initialBounds) {
|
||||
// open external links in default browser - a tag with href='_blank' or window.open
|
||||
mainWindow.webContents.on('new-window', function (event, newWinUrl,
|
||||
frameName, disposition, newWinOptions) {
|
||||
|
||||
|
||||
let newWinParsedUrl = getParsedUrl(newWinUrl);
|
||||
let mainWinParsedUrl = getParsedUrl(url);
|
||||
|
||||
@ -319,10 +319,11 @@ function doCreateMainWindow(initialUrl, initialBounds) {
|
||||
let mainWinHost = mainWinParsedUrl && mainWinParsedUrl.host;
|
||||
|
||||
let emptyUrlString = 'about:blank';
|
||||
|
||||
let dispositionWhitelist = ['new-window', 'foreground-tab'];
|
||||
|
||||
// only allow window.open to succeed is if coming from same hsot,
|
||||
// otherwise open in default browser.
|
||||
if (disposition === 'new-window' && ((newWinHost === mainWinHost) || newWinUrl === emptyUrlString)) {
|
||||
if ((newWinHost === mainWinHost || newWinUrl === emptyUrlString) && dispositionWhitelist.includes(disposition)) {
|
||||
// handle: window.open
|
||||
|
||||
if (!frameName) {
|
||||
|
Loading…
Reference in New Issue
Block a user