https://github.com/macadmins/default-browser
A command line utility for setting the default browser for a user on macOS
https://github.com/macadmins/default-browser
Last synced: 5 months ago
JSON representation
A command line utility for setting the default browser for a user on macOS
- Host: GitHub
- URL: https://github.com/macadmins/default-browser
- Owner: macadmins
- License: apache-2.0
- Created: 2025-02-19T22:50:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-10-01T06:20:19.000Z (9 months ago)
- Last Synced: 2025-10-23T23:36:20.504Z (8 months ago)
- Language: Go
- Size: 206 KB
- Stars: 42
- Watchers: 6
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# default-browser
This is a tool that will set the default browser for the current user on a macOS device.
## Usage
```shell
/opt/macadmins/bin/default-browser --identifier com.google.chrome
```
To set other browsers as the default, use the following identifiers:
- Google Chrome (the default if no identifier is passed): `com.google.chrome`
- Safari: `com.apple.safari`
- Firefox: `org.mozilla.firefox`
- MS Edge: `com.microsoft.edgemac`
## Known issues
### System Settings may not work correctly
If System Settings doesn't show all sections correctly after running, this tool, restart the machine. This is likely a timing issue with Launch Services, but we haven't reproduced it consistently. If you see that a restart doesn't fix the issue, you way wish to use the `---no-rebuild-launchservices` flag. This will mean that you need to reboot after running the tool.
