diff --git a/app-shell-odd/src/ui.ts b/app-shell-odd/src/ui.ts index ec5f3e1ae0a..fdae0e8a54d 100644 --- a/app-shell-odd/src/ui.ts +++ b/app-shell-odd/src/ui.ts @@ -59,11 +59,13 @@ export function createUi(dispatch: Dispatch): BrowserWindow { mainWindow.loadURL(url, { extraHeaders: 'pragma: no-cache\n' }) // open new windows ( { - log.debug('Opening external link', { url }) - event.preventDefault() - // eslint-disable-next-line @typescript-eslint/no-floating-promises - shell.openExternal(url) + mainWindow.webContents.setWindowOpenHandler(({ url, disposition }) => { + if (disposition === 'new-window' && url === 'about:blank') { + shell.openExternal(url) + return { action: 'deny' } + } else { + return { action: 'allow' } + } }) return mainWindow