自定义源新增更新弹窗方法

This commit is contained in:
lyswhut
2022-02-16 18:32:55 +08:00
parent a7e3c1a0c4
commit 3534dd27dc
19 changed files with 134 additions and 26 deletions
+5 -1
View File
@@ -15,7 +15,6 @@ fs.readFile(path.join(dir, 'renderer/user-api.html'), 'utf8', (err, data) => {
})
const denyEvents = [
'new-window',
'will-navigate',
'will-redirect',
'will-attach-webview',
@@ -49,11 +48,13 @@ exports.createWindow = async userApi => {
contextIsolation: true,
// worldSafeExecuteJavaScript: true,
nodeIntegration: false,
nodeIntegrationInWorker: false,
spellcheck: false,
autoplayPolicy: 'document-user-activation-required',
enableWebSQL: false,
disableDialogs: true,
nativeWindowOpen: false,
webgl: false,
images: false,
@@ -70,6 +71,9 @@ exports.createWindow = async userApi => {
// eslint-disable-next-line node/no-callback-literal
callback(false)
})
global.modules.userApiWindow.webContents.setWindowOpenHandler(() => {
return { action: 'deny' }
})
winEvent(global.modules.userApiWindow)