From 7c27f9098c9b14c0ecf46e17bad1ccfa5ab9a160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Ciarcin=CC=81ski?= Date: Tue, 1 Sep 2026 16:41:02 +0200 Subject: [PATCH] Fix opening a deep-link --- src-tauri/src/bin/defguard-client.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/bin/defguard-client.rs b/src-tauri/src/bin/defguard-client.rs index 6a9e00af..04ff7103 100644 --- a/src-tauri/src/bin/defguard-client.rs +++ b/src-tauri/src/bin/defguard-client.rs @@ -24,8 +24,15 @@ fn main() { // Handle --version / -V before starting the client. check_version_flag("defguard-client"); - // Without any arguments, launch the user interface. - if env::args().count() <= 1 { + // On Windows and Linux a deep-link launches a new process with the URL as its only + // argument. That must start the GUI, not the CLI. + let is_deep_link = if let Some(value) = env::args().nth(1) { + value.starts_with("defguard://") + } else { + false + }; + + if env::args().count() <= 1 || is_deep_link { #[cfg(target_os = "linux")] set_webkitgtk_variables(); run_app();