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
swift build -c release
cp .build/release/BrowserSwitcher /usr/local/bin/Then run BrowserSwitcher from the terminal. It will appear in your menu bar.
- 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 |
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
- 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.
