Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/7054

Vanessadf89ad3cbfbc
diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.ts
index 07ef34c570..4fe61b4400 100644
--- a/app/src/protyle/export/index.ts
+++ b/app/src/protyle/export/index.ts
@@ -1,7 +1,7 @@
import {hideMessage, showMessage} from "../../dialog/message";
import {Constants} from "../../constants";
/// #if !BROWSER
-import {OpenDialogReturnValue} from "electron";
+import {OpenDialogReturnValue, shell} from "electron";
import {app, BrowserWindow, dialog, getCurrentWindow} from "@electron/remote";
import * as fs from "fs";
import * as path from "path";
@@ -469,6 +469,13 @@ const renderPDF = (id: string) => {
webSecurity: false,
},
});
+ window.siyuan.printWin.webContents.on('will-navigate', (event, url) => {
+ if (url.indexOf(location.host) > -1) {
+ return
+ }
+ event.preventDefault()
+ shell.openExternal(url)
+ })
window.siyuan.printWin.webContents.userAgent = `SiYuan/${app.getVersion()} https://b3log.org/siyuan Electron`;
fetchPost("/api/export/exportTempContent", {content: html}, (response) => {
window.siyuan.printWin.loadURL(response.data.url);