diff --git a/electron/main/index.ts b/electron/main/index.ts index 5e429cd..a1bed6c 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -68,10 +68,11 @@ async function createWindow() { }) // Make all links open with the browser, not with the application - win.webContents.on('will-navigate', (event, url) => { - event.preventDefault() - shell.openExternal(url) + win.webContents.setWindowOpenHandler(({ url }) => { + if (url.startsWith('https:')) shell.openExternal(url) + return { action: 'deny' } }) + // win.webContents.on('will-navigate', (event, url) => { }) #344 } app.whenReady().then(createWindow)