diff --git a/packages/apps-electron/src/electron/index.ts b/packages/apps-electron/src/electron/index.ts index 20d2983b77..c12d852037 100644 --- a/packages/apps-electron/src/electron/index.ts +++ b/packages/apps-electron/src/electron/index.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { app } from 'electron'; +import { app, shell } from 'electron'; import { registerAccountStoreHandlers } from '../main/account-store'; import { setupAutoUpdater } from './autoUpdater'; import { createWindow } from './window'; @@ -15,4 +15,11 @@ const onReady = async () => { await setupAutoUpdater(); }; +app.on('web-contents-created', (e, webContents) => { + webContents.on('new-window', (e, url) => { + e.preventDefault(); + shell.openExternal(url).catch(console.error); + }); +}); + app.whenReady().then(onReady).catch(console.error);