Skip to content

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

:art: iframe 使用短网址会打开浏览器或跳转 APP Fix https://github.com/siyuan-note/siyuan/issues/6327

Liang Ding7a99f9078e41
diff --git a/app/electron/main.js b/app/electron/main.js
index 726b46ac67..6c4580fa1a 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -336,12 +336,15 @@ const boot = () => {
})
// iframe 使用短网址会打开浏览器或跳转 APP https://github.com/siyuan-note/siyuan/issues/6327
- mainWindow.webContents.on('will-redirect', (event, url) => {
+ mainWindow.webContents.on('will-redirect', (event, url, isInPlace, isMainFrame) => {
if (url.startsWith('http://127.0.0.1:6806')) {
return
}
- event.preventDefault()
+ if (!isMainFrame) {
+ event.preventDefault()
+ return
+ }
})
mainWindow.on('close', (event) => {