fix: resolve Firefox/Chromium profiles when the browser is configured by path#529
fix: resolve Firefox/Chromium profiles when the browser is configured by path#529xrl wants to merge 2 commits into
Conversation
resolveBrowserProfileArgs and GetProfilesForBrowser looked up the browser
in browsers.json by bundle ID or app name only. A handler that specifies
the browser by path (appType "path", e.g. name "/Applications/Firefox.app")
passes that path as the identifier, which matches neither, so no profile
argument was emitted and the browser opened without the requested profile.
For Firefox this had a worse symptom: with no profile argument the launch
fell into Firefox's default profile selection, which on recent versions
shows the new profile-selector ("ShowSelector") window. Passing -P/-profile
avoids that path entirely.
Add findBrowserInfo, which also matches an ".app" bundle path by its
basename (minus ".app") against the app name, and use it in both call
sites. Profile detection now works for path-based configs for Firefox and
Chromium alike.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The local build path ran `mv Finicky-arm64.app Finicky.app` without first removing an existing build/Finicky.app. If one was left from a previous build, mv nested the new bundle inside the old directory and, under `set -e`, the script aborted before copying to /Applications -- silently leaving the previously installed app in place. Remove the destination bundle before the mv. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR consolidates browser matching logic into a single reusable helper and fixes a build-script race condition. The ChangesBrowser lookup consolidation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
When a handler specifies the browser by path (
appType: "path"), e.g.the requested profile is silently ignored and the browser opens without it.
For Firefox the symptom is worse: with no profile argument, the launch falls into Firefox's default profile selection, which on recent versions (the new multi-profile feature —
ShowSelectorinprofiles.ini) pops the profile picker window on every link instead of opening the chosen profile.Root cause
resolveBrowserProfileArgs(andGetProfilesForBrowser) look up the browser inbrowsers.jsonby bundle ID or app name only:With
appType: "path"the identifier is the bundle path (/Applications/Firefox.app), which matches neitherorg.mozilla.firefoxnorFirefox, so no match is found and no profile argument is emitted.Fix
Add
findBrowserInfo, which additionally matches an.appbundle path by its basename (minus.app) against the app name, and use it in both call sites. Profile detection now works for path-based configs for Firefox and Chromium alike. The usual-P <name>(Firefox) /--profile-directory=(Chromium) argument is emitted as before — which, for Firefox, also keeps the launch out of the default-selection path that triggers the picker.Behavior for bundle-ID and app-name configs is unchanged.
Tests
Added
launcher_test.gocoveringfindBrowserInfo: match by app name, bundle ID, and.apppath (including names with spaces such as "Firefox Developer Edition"), Chromium by path, plus negative cases (unknown app, unknown path, and no partial-prefix match).Verified
Built and run locally on macOS (Apple Silicon, Firefox 151): links now open in the configured profile with no profile-picker window, routing into the running per-profile instance as a new tab.
The second commit is a small, unrelated build fix: the local
build.shpath couldmva freshly built bundle into a stalebuild/Finicky.appand then abort underset -ebefore installing, silently leaving the old app in place. Happy to split it into its own PR if you'd prefer.🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests