Skip to content

Fix default browser detection using malformed URL NSWorkspace.urlForA…#5224

Open
umutkonmus wants to merge 1 commit intoRanchero-Software:mainfrom
umutkonmus:fix/default-browser-detection
Open

Fix default browser detection using malformed URL NSWorkspace.urlForA…#5224
umutkonmus wants to merge 1 commit intoRanchero-Software:mainfrom
umutkonmus:fix/default-browser-detection

Conversation

@umutkonmus
Copy link
Copy Markdown

@umutkonmus umutkonmus commented Mar 31, 2026

Fix default browser detection using malformed URL NSWorkspace.urlForApplication(toOpen:) was called with "https:///"

(malformed, no host), which caused macOS to sometimes return Safari regardless of the actual system default browser.

Fixed by using a valid HTTPS URL (https://apple.com/) so the system correctly resolves the default handler.

Also fixed the browser popup selection logic to explicitly handle the nil-defaultBrowserID case, and removed force-unwraps on icon/name.

Fixes #5220

…pplication(toOpen:) was called with "https:///"

(malformed, no host), which caused macOS to sometimes return Safari
regardless of the actual system default browser.

Fixed by using a valid HTTPS URL (https://apple.com/) so the system
correctly resolves the default handler.

Also fixed the browser popup selection logic to explicitly handle the
nil-defaultBrowserID case, and removed force-unwraps on icon/name.

Fixes Ranchero-Software#5220
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MacOS app doesn't correctly detect system default browser

1 participant