refactor: 💡 Update deprecated new window handler (#1111)
✅ Closes: ICU-4037
This commit is contained in:
1 parent
1b9f774937
commit
df609dcf2c
1 file changed
+4
-3
@@ -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', () => {
|
||||
|
||||
Reference in new issue
Block a user