Command line tool for setting the default browser (HTTP handler) in macOS X.
Build it:
gcc -o defaultbrowser -O2 -framework Foundation -framework ApplicationServices src/main.m
Move it into your executable path:
cp defaultbrowser /usr/local/bin/
Set the default browser with:
defaultbrowser -set chrome
Running defaultbrowser
without arguments shows the current setting.
The code uses the macOS Launch Services API.
MIT