cdef and defaultbrowserĬdef and defaultbrowser allow you to set the default browser.
I think this is a great option (and not just because I worked hard on it), but I also outline below some other options. If you want to use this in conjunction with Outset but not have the settings change for existing users (only new ones), you can use this preinstall script to fake-run the login-once script for each existing user. On the other hand, in terms of practical use, you're not likely to want to script changing the default browser multiple times on one machine-the whole point of scripting it is likely to just make an initial default the user can change later on her own should she choose to, and she can use the GUI to do that. Sometimes changing the default browser through the GUI and then running the script again will have it work again. If you run it again to switch to another browser, you may have to reboot for the change to take effect. I wrote up a script that changes the default browser silently, but it works well only the first time you run it. It's not, as far as I can tell! I'd love to be corrected on this. You would think it would be fairly simple to script changing the default browser to Chrome in macOS.