A lightweight macOS menu bar utility to switch your default browser with a global keyboard shortcut.
- Lives in the menu bar -- no Dock icon, no Cmd+Tab clutter
- Global keyboard shortcut to open the browser picker from anywhere
- Shows all installed browsers with their icons
- Highlights the current default browser
- Customizable shortcut via Settings
- Built with SwiftUI and AppKit
git clone https://github.com/gabrielMalonso/BrowserSwitcher.git
cd BrowserSwitcher
./scripts/build-app.sh
open -R build/BrowserSwitcher.appQuit any running copy, then drag build/BrowserSwitcher.app into Applications in Finder, choosing Replace if an older copy exists. Open the installed app. Replace the whole app bundle so obsolete files from older builds are not merged into the signed app.
The build script packages the executable, app icon, and all SwiftPM resource bundles, then signs and verifies the app locally. The installed app does not need the source checkout or .build directory to run.
Use the app bundle for installation: copying only the executable leaves its resource bundles behind and can make startup or Settings crash.
- Clone the repository
- Open
Package.swiftin Xcode - Build and run (Cmd+R)
| Action | How |
|---|---|
| Open browser picker | Cmd + Shift + Option + B (default) |
| Close picker | ESC or click outside |
| Switch browser | Click on the desired browser |
| Change shortcut | Menu bar icon > Settings |
| Quit | Menu bar icon > Quit |
The default shortcut applies only until you choose another one in Settings. If the menu bar icon is hidden, use your saved shortcut or reopen BrowserSwitcher from Spotlight to access the picker and Settings.
Note: macOS shows a native confirmation dialog when changing the default browser. This is a system-level protection and cannot be bypassed.
- macOS 14 (Sonoma) or later
- Xcode selected as the active developer directory when building from source
- The app must run outside the sandbox (it cannot be distributed via the Mac App Store)
- Uses
NSWorkspace.urlsForApplications(toOpen:)to discover installed browsers by intersecting apps that handle bothhttps:URLs and.htmlcontent types - Uses
NSWorkspace.setDefaultApplication(at:toOpenURLsWithScheme:completion:)to change the default browser (settinghttpis enough -- macOS linkshttp,https, andpublic.htmltogether) - Uses KeyboardShortcuts by @sindresorhus for global hotkey registration without requiring Accessibility permissions
- Uses a floating
NSPanelfor the picker popup
Contributions are welcome! Please read CONTRIBUTING.md before submitting a pull request.
This project is licensed under the MIT License. See LICENSE for details.
