From 6ee7c04d0283008e1832f21453c9b0391f3006e1 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Fri, 22 May 2026 18:39:22 +0200 Subject: [PATCH] fix(desktop): recover deep-link URL from argv on win/linux cold start setupDeepLinks() only listened for second-instance and open-url events. On Windows/Linux a fresh launch via `surfsense://` delivers the URL in argv of the first instance, where it was silently dropped. Scan argv on setup so the existing handlePendingDeepLink() pass picks it up. --- surfsense_desktop/src/modules/deep-links.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/surfsense_desktop/src/modules/deep-links.ts b/surfsense_desktop/src/modules/deep-links.ts index 11b7bfcff..7d5e429bd 100644 --- a/surfsense_desktop/src/modules/deep-links.ts +++ b/surfsense_desktop/src/modules/deep-links.ts @@ -60,6 +60,11 @@ export function setupDeepLinks(): boolean { app.setAsDefaultProtocolClient(PROTOCOL); } + // Cold-start on Windows/Linux: protocol URL arrives via argv of the + // first instance, not via `second-instance` or `open-url`. + const cold = process.argv.find((arg) => arg.startsWith(`${PROTOCOL}://`)); + if (cold) handleDeepLink(cold); + return true; }