Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

How do I change the default browser for root in OS X 10.8.3

Do I need to enable the root user first?

share|improve this question
    
Why would you want to do that? Are you trying to change the default browser for every user of the machine? Just so you know, changing the default browser of root would not do the trick! –  Frizlab Apr 24 '13 at 1:55
1  
This question is answerable with a simple yes or no but that answer most probably is not what you are looking for. Can you please elaborate a bit on why you want to change the default browser in the first place and/or which actual problem you are trying to solve? –  patrix Apr 24 '13 at 5:24
1  
I run two instances of Skype and launch one from the terminal via Sudo. I suppose one safer solution would be to make a 'Skype' user and launch under them after loging in and setting the default browser but I was curious how to set the browser for the root user. –  ian Apr 24 '13 at 16:27

2 Answers 2

up vote 2 down vote accepted

Launch this from the terminal:

sudo -u root /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome

It will ask you whether you want to set Google Chrome as your default browser. I assume the same technique works for Firefox and most browsers.

I had the same problem when running Skype as root and it fixed my problem (it opens links in Chrome instead of Safari now).

share|improve this answer
    
Awesome. Thanks. –  ian Sep 18 '13 at 2:17

The default browser is stored in ~/Library/Preferences/com.apple.LaunchServices.plist as those records (my default browser is Mozilla Firefox):

    <dict>
        <key>LSHandlerContentType</key>
        <string>public.html</string>
        <key>LSHandlerRoleAll</key>
        <string>org.mozilla.firefox</string>
    </dict>
    <dict>
        <key>LSHandlerContentType</key>
        <string>public.xhtml</string>
        <key>LSHandlerRoleAll</key>
        <string>org.mozilla.firefox</string>
    </dict>
    <dict>
        <key>LSHandlerRoleAll</key>
        <string>org.mozilla.firefox</string>
        <key>LSHandlerURLScheme</key>
        <string>http</string>
    </dict>
    <dict>
        <key>LSHandlerRoleAll</key>
        <string>org.mozilla.firefox</string>
        <key>LSHandlerURLScheme</key>
        <string>https</string>
    </dict>

This file contains all the other default associations between specific resources and applications. You could copy a version of this file to the Library/Preferences folder of the user you want to apply those settings to.

As stated by previous comments, it seems very weird to change that for the root user as you're not expected to use this account in the GUI.

share|improve this answer
    
I tried moving my user ~/Library/Preferences/com.apple.LaunchServices.plist file into the root Library/Preferences folder which had no com.apple.LaunchServices.plist file and restarting but no luck. I run two copies of Skype and have to launch one through the terminal in order to run them together thus one opens links in Safari which I dont like to use. –  ian Apr 24 '13 at 16:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.