mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-06-21 21:53:50 +08:00
feat(deeplink): add support for apt:// protocol handling
- Register apt protocol handler in Electron main process - Add x-scheme-handler/apt MIME type to electron-builder config - Update desktop entry to include apt MIME type support - apt://pkgname links are now converted to spk://search/pkgname refs #IJTPFP
This commit is contained in:
@@ -26,6 +26,7 @@ linux:
|
||||
Categories: "System;"
|
||||
mimeTypes:
|
||||
- "x-scheme-handler/spk"
|
||||
- "x-scheme-handler/apt"
|
||||
target:
|
||||
- "AppImage"
|
||||
- "deb"
|
||||
|
||||
@@ -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(() => {
|
||||
// Set User-Agent for client
|
||||
session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => {
|
||||
|
||||
@@ -10,4 +10,4 @@ Keywords=appstore;
|
||||
Terminal=false
|
||||
StartupNotify=true
|
||||
StartupWMClass=spark-store
|
||||
MimeType=x-scheme-handler/spk
|
||||
MimeType=x-scheme-handler/spk;x-scheme-handler/apt
|
||||
|
||||
Reference in New Issue
Block a user