Swift script and Alfred workflow to change the default browser on macOS.
To run the Swift script:
- 🚧 Make it executable:
chmod +x defaultbrowser.swift
- 🚀 Run it:
./defaultbrowser.swift <browser>
- 👍 Acknowledge the system popup asking you if you're sure what you're doing.
Change the default browser to Chrome:
./defaultbrowser.swift chrome
Change the default browser to Safari:
./defaultbrowser.swift safari
You get the point.
Download the repository and open the defaultbrowser.alfredworkflow
file. The keyword is db
and expects the browser you want to set as default as an argument.
At the moment, the workflow is very basic. Nice features would be:
- Showing the matching available browsers while typing such as this workflow that shows matching processes while typing
- A cool icon
- Anything more you might like
🤓 Feel free to share ideas, criticism and open pull requests.