refactor: 💡 Update deprecated new window handler (#1111)

✅ Closes: ICU-4037
This commit is contained in:
Zhihe Li authored and GitHub committed 2022-05-20 12:53:52 -04:00
1 parent 1b9f774937
commit df609dcf2c
1 file changed
+4 -3
+4 -3
View File
@@ -115,12 +115,13 @@ const createWindow = (partition, closeWindowCB) => {
// Opens external links in the host default browser.
// We just allow boundaryproject.io domain to open on external window (for now).
browserWindow.webContents.on('new-window', (event, url) => {
/* eng-disable LIMIT_NAVIGATION_JS_CHECK */
event.preventDefault();
browserWindow.webContents.setWindowOpenHandler(({ url }) => {
if (url.startsWith('https://boundaryproject.io/')) {
shell.openExternal(url);
}
// Prevent opening of a browser window in electron
return { action: 'deny' };
});
browserWindow.on('unresponsive', () => {