fix: prevent navigate to new url

This commit is contained in:
kangfenmao
2024-07-23 19:08:36 +08:00
parent 1e1414d659
commit 3625eefec4

View File

@@ -52,6 +52,11 @@ function createWindow() {
menu.popup()
})
mainWindow.webContents.on('will-navigate', (event, url) => {
event.preventDefault()
shell.openExternal(url)
})
mainWindow.on('ready-to-show', () => {
mainWindow.show()
})