禁止打开非http协议链接
This commit is contained in:
@@ -54,6 +54,7 @@ app.on('web-contents-created', (event, contents) => {
|
||||
event.preventDefault()
|
||||
if (/^devtools/.test(navigationUrl)) return
|
||||
console.log(navigationUrl)
|
||||
if (!/^https?:\/\//.test(navigationUrl)) return
|
||||
await shell.openExternal(navigationUrl)
|
||||
})
|
||||
contents.on('will-attach-webview', (event, webPreferences, params) => {
|
||||
|
||||
Reference in New Issue
Block a user