feat: route links from a menu-bar popover as the default browser - #1
Merged
Merged
Conversation
Add Sparkle as an SPM dependency so Check for Updates can compile, point package_app.sh at build-release.sh, and hug popover height from onGeometryChange instead of fittingSize.
onGeometryChange is macOS 15+. The popover already uses fixedSize, so a background GeometryReader reports the same intrinsic height. make check now also swift-builds the app target so this cannot slip past tests.
swift test only compiles BrowserouteCore. CI also swift-builds the app target, so check must too — otherwise MenuView/Router never hit the pre-push gate.
Render the charcoal squircle at 1024, emit a classic Icon.iconset (16 through 512@2x), and compile Icon.icns so About/Finder stop using the generic executable glyph. package_app.sh rebuilds the icns from the iconset. README uses the same mark. Settings shows a checked Default Browser row when Browseroute already owns https, instead of a greyed-out button. Claiming https first avoids a second confirmation dialog for http.
The checkmark used only https, so accepting that dialog and cancelling http still showed Default Browser while http:// links stayed in Chrome. Both schemes must match. After a successful https claim, always request http too — probing LaunchServices immediately is a race.
Clicking Set as Default Browser called setDefaultApplication while the transient popover was closing. LaunchServices cancelled in ~12ms, so the system prompt never appeared. Claim from a long-lived helper, switch to a regular activation policy for the prompt, and ignore resign-active / click-outside until it finishes.
macOS treats http and https as one default-browser setting. Claiming
https first failed with NSCocoaErrorDomain 256 ("The file couldn’t be
opened.") and never showed the confirmation dialog. Claim http only;
the checkmark still requires both schemes.
urlForApplication(withBundleIdentifier:) can return build/ or dist/ instead of the process that is actually running. Claim Bundle.main so the checkmark and the handler point at the same app.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Route
http/httpsas the macOS default browser from a menu-bar popover. Chrome BrowserSwitcher and~/.config/browseroute/config.jsonare gone.This branch also:
Sparkle.frameworkat package time. Check for Updates stays disabled until a realSUPublicEDKeyis baked in (the placeholder still starts withREPLACE_).Scripts/package_app.shatScripts/build-release.sh.GeometryReader+PreferenceKeyso the Routing toggle does not stretch the browser-config screen.Verified locally:
make check— lint, appswift build, 19 tests.SKIP_NOTARIZE=1dry-run of./Scripts/build-release.sh— universal build, Sparkle inside-out sign,codesign --verifypasses, zip indist/.Not in this PR (needed before tagging
v*):releaseenvironment + secrets (DEVELOPER_ID_APP_P12_BASE64,DEV_ID_P12_PASSWORD,APP_IDENTITY,NOTARY_KEY_P8_BASE64,NOTARY_KEY_ID,NOTARY_ISSUER_ID,HOMEBREW_TAP_TOKEN).SUPublicEDKey+SPARKLE_PRIVATE_KEYfor appcast signing.