!395 新增 spark-store 支持处理 apt://包名 格式的链接,转成 spk://search/包名协议来处理

Merge pull request !395 from 球球代码研发助手/implement-33298693-3R1t
This commit is contained in:
2026-06-10 12:13:44 +00:00
committed by Gitee
3 changed files with 17 additions and 1 deletions
+1
View File
@@ -26,6 +26,7 @@ linux:
Categories: "System;" Categories: "System;"
mimeTypes: mimeTypes:
- "x-scheme-handler/spk" - "x-scheme-handler/spk"
- "x-scheme-handler/apt"
target: target:
- "AppImage" - "AppImage"
- "deb" - "deb"
+15
View File
@@ -318,6 +318,21 @@ ipcMain.handle("check-for-updates", async () => {
} }
}); });
// Register custom protocol handlers
if (process.defaultApp) {
if (process.argv.length >= 2) {
app.setAsDefaultProtocolClient("spk", process.execPath, [
path.resolve(process.argv[1]),
]);
app.setAsDefaultProtocolClient("apt", process.execPath, [
path.resolve(process.argv[1]),
]);
}
} else {
app.setAsDefaultProtocolClient("spk");
app.setAsDefaultProtocolClient("apt");
}
app.whenReady().then(() => { app.whenReady().then(() => {
// Set User-Agent for client // Set User-Agent for client
session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => { session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => {
@@ -10,4 +10,4 @@ Keywords=appstore;
Terminal=false Terminal=false
StartupNotify=true StartupNotify=true
StartupWMClass=spark-store StartupWMClass=spark-store
MimeType=x-scheme-handler/spk MimeType=x-scheme-handler/spk;x-scheme-handler/apt