fix(#344): location.reload() causes open browser

This commit is contained in:
草鞋没号 2023-02-24 18:05:48 +08:00
parent efaa80cd11
commit 8720ba1f8a

View File

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