3

I have a custom built browser, lets say its similar to a firefox port such as Ice Weasel. I am wondering where I register this so that it will appear in the System Preferences > General > Default Browser menu.

I can view the current defaults on the command line from:

defaults read ~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist

However, this only seems to give me what is actually set as my defaults and not as what CAN be set as my defaults. It's the latter portion that I am interested in. What do I need to do in order to register my custom browser so that it can be set as the default?

I'm guessing there is a .plist file somewhere for that?

  • Does the defaults read defaults read... have a special reason or is it just an error? – klanomath Dec 14 '15 at 18:49
  • it was a typo. thanks for catching it. i fixed it :) – Dan Dec 14 '15 at 18:59
7

You don't add yourself to this plist—OS X manages this itself. For example, download a new browser and copy it to the Applications folder. Without opening it once, OS X will add it to the list in System Preferences.

This is achieved with the following in the Info.plist in the app:

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>http URL</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>http</string>
        </array>
    </dict>
    <dict>
        <key>CFBundleURLName</key>
        <string>Secure http URL</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>https</string>
        </array>
    </dict>
</array>
| improve this answer | |
  • if you want the custom browser to open file:// URL schemes, add this as well between the last </dict> and the </array>: <dict> <key>CFBundleURLName</key> <string>Local file URL</string> <key>CFBundleURLSchemes</key> <array> <string>file</string> </array> </dict> – jbeldock Mar 18 '17 at 23:35
  • Did you know you can cut and paste this into any apps info.plist. You have to move it out of Applications, then move it back in again, and it will add itself to the possible browser list in the General system preference. Now Notepad is my new default browser! – frumbert Nov 16 '18 at 6:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .