Ehcho.com

Example default web browser plist

22 Sep 2013 | Last updated: Never

If you wish the set a preference to automatically set the default web browser to something other than Safari, use the following snippet. More information on using this can be found in "MCX: Configure default web browser".

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>LSHandlers</key>
    <array>
      <dict>
        <key>LSHandlerRoleAll</key>
        <string>COM.EXAMPLE.APPNAME</string>
        <key>LSHandlerURLScheme</key>
        <string>http</string>
      </dict>
      <dict>
        <key>LSHandlerRoleAll</key>
        <string>COM.EXAMPLE.APPNAME</string>
        <key>LSHandlerURLScheme</key>
        <string>https</string>
      </dict>
      <dict>
        <key>LSHandlerContentType</key>
        <string>public.html</string>
        <key>LSHandlerRoleViewer</key>
        <string>COM.EXAMPLE.APPNAME</string>
      </dict>
      <dict>
        <key>LSHandlerContentType</key>
        <string>public.url</string>
        <key>LSHandlerRoleViewer</key>
        <string>COM.EXAMPLE.APPNAME</string>
      </dict>
    </array>
  </dict>
</plist>

Replace "COM.EXAMPLE.APPNAME" with the web browsers bundle identifier.

Save the file as com.apple.LaunchServices.plist.