Warning – this solution requires you understand how to build software from source code
When you install an alternate web browser that you wish to use as your default, they’ll generally ask if you want to make the browser your ‘default’ web browser. This is fine and dandy, but Apple doesn’t exactly hand over the reigns at that point. Case in point, if you’ve set your default browser to ‘Chrome’, as I have – if you use the /usr/bin/open command to open an HTML file, it’ll still load up in Safari. I wondered how I could figure out where that was getting hooked, and ultimately found the answer in the open source package DUTI.
DUTI provides a CLI interface for querying and modifying the default application registry using Apple’s Uniform Type Identifiers (UTI). As an example, Safari’s UTI is com.apple.Safari whereas my build of Chromium reports itself as org.chromium.Chromium.
DUTI shows in it’s examples how to set the default handler for HTML documents:
duti -s com.apple.Safari public.html all
So, to make sure that /usr/bin/open directs things correctly – I simply had to run:
duti -s org.chromium.Chromium public.html all
And open started working correctly.
You can also get information about registered file extensions using:
duti -x
Example:
% duti -x jpg
Preview
/Applications/Preview.app
com.apple.Preview
