From 0f522fa794d701581782c9ef35c44fa8dd8a3131 Mon Sep 17 00:00:00 2001 From: nimbold <11913706+nimbold@users.noreply.github.com> Date: Thu, 4 Jun 2026 00:24:32 +0330 Subject: [PATCH] fix(ui): explicitly route about:debugging to firefox to prevent LaunchServices error --- Sources/Firelink/SettingsView.swift | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Sources/Firelink/SettingsView.swift b/Sources/Firelink/SettingsView.swift index 07995ab..66d8c25 100644 --- a/Sources/Firelink/SettingsView.swift +++ b/Sources/Firelink/SettingsView.swift @@ -727,8 +727,24 @@ private struct IntegrationSettingsPane: View { } private func openFirefoxDebugging() { - if let url = URL(string: "about:debugging#/runtime/this-firefox") { - NSWorkspace.shared.open(url) + guard let url = URL(string: "about:debugging#/runtime/this-firefox") else { return } + + let bundleIDs = [ + "org.mozilla.firefoxdeveloperedition", + "org.mozilla.firefox", + "org.mozilla.nightly" + ] + + let workspace = NSWorkspace.shared + for id in bundleIDs { + if let appURL = workspace.urlForApplication(withBundleIdentifier: id) { + let config = NSWorkspace.OpenConfiguration() + workspace.open([url], withApplicationAt: appURL, configuration: config, completionHandler: nil) + return + } } + + // Fallback + workspace.open(url) } }