Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:recycle: Electron new-window 事件替换

Liang Ding223677e4628f
diff --git a/app/electron/main.js b/app/electron/main.js
index d71e45a935..961b29a960 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -783,6 +783,11 @@ app.on('web-contents-created', (webContentsCreatedEvent, contents) => {
newWindowEvent.preventDefault()
shell.openExternal(url)
})
+
+ contents.setWindowOpenHandler((details) => {
+ shell.openExternal(details.url)
+ return {action: 'deny',}
+ })
})
app.on('before-quit', (event) => {