Skip to content

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

:art: Support `siyuan://` protocol on macOS https://github.com/siyuan-note/siyuan/issues/12271

Daniel59950dde4110
diff --git a/app/electron-builder-darwin-arm64.yml b/app/electron-builder-darwin-arm64.yml
index d8fb393f9a..586e7ac574 100644
--- a/app/electron-builder-darwin-arm64.yml
+++ b/app/electron-builder-darwin-arm64.yml
@@ -22,6 +22,10 @@ mac:
- NSMicrophoneUsageDescription: "This app requires microphone access to record audio."
entitlementsInherit: "../../entitlements.mas.plist"
minimumSystemVersion: "10.15"
+ protocols:
+ - name: "SiYuan"
+ schemes:
+ - "siyuan"
extraResources:
- from: "kernel-darwin-arm64"
to: "kernel"
diff --git a/app/electron-builder-darwin.yml b/app/electron-builder-darwin.yml
index 6b6459ee62..a026da6c3f 100644
--- a/app/electron-builder-darwin.yml
+++ b/app/electron-builder-darwin.yml
@@ -22,6 +22,10 @@ mac:
- NSMicrophoneUsageDescription: "This app requires microphone access to record audio."
entitlementsInherit: "../../entitlements.mas.plist"
minimumSystemVersion: "10.15"
+ protocols:
+ - name: "SiYuan"
+ schemes:
+ - "siyuan"
extraResources:
- from: "kernel-darwin"
to: "kernel"
diff --git a/app/electron/main.js b/app/electron/main.js
index 9ab5ebfff8..2360c3fff1 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -387,10 +387,7 @@ const initMainWindow = () => {
});
currentWindow.webContents.on("did-finish-load", () => {
- let siyuanOpenURL;
- if ("win32" === process.platform || "linux" === process.platform) {
- siyuanOpenURL = process.argv.find((arg) => arg.startsWith("siyuan://"));
- }
+ let siyuanOpenURL = process.argv.find((arg) => arg.startsWith("siyuan://"));
if (siyuanOpenURL) {
if (currentWindow.isMinimized()) {
currentWindow.restore();