mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-28 09:51:06 -06:00
SDA-3662 - Fix window will navigate issue on main webContents (#1395)
This commit is contained in:
parent
ca983d847e
commit
4494e19956
2
package-lock.json
generated
2
package-lock.json
generated
@ -18997,4 +18997,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -158,7 +158,14 @@ export const preventWindowNavigation = (
|
||||
}
|
||||
};
|
||||
|
||||
browserWindow.webContents.on('will-navigate', listener);
|
||||
if (isPopOutWindow) {
|
||||
browserWindow.webContents.on('will-navigate', listener);
|
||||
} else {
|
||||
const mainWebContents = windowHandler.getMainWebContents();
|
||||
if (mainWebContents && !mainWebContents.isDestroyed()) {
|
||||
mainWebContents.on('will-navigate', listener);
|
||||
}
|
||||
}
|
||||
|
||||
browserWindow.once('close', () => {
|
||||
browserWindow.webContents.removeListener('will-navigate', listener);
|
||||
|
Loading…
Reference in New Issue
Block a user