Default Web Browser 10.9+

nessts
Valued Contributor II

Hi, has anybody been successful in enforcing the default web browser on 10.9 or higher?
I started with a configuration profile assuming that would be the right way to go, and I found on 10.9 that it did set it once but did not persist. Well that is not quite true the com.apple.LaunchServices file still says firefox but if I graphically change it to any other browser it changes and persists through reboots.
Next I tried the MCX https://jamfnation.jamfsoftware.com/discussion.html?id=9179 and using the MCX troubleshooting guide https://jamfnation.jamfsoftware.com/article.html?id=144 I have verified that firefox should be the default browser but it does not enforce it ever. through man reboots even.

10.10 it seems that Apple has changed things for the fun of it and com.apple.LaunchServices is a directory with at least one plist inside of it. Neither the MCX or the profile did anything, although using the debug stuff MCX says the default browser is firefox, and yet whatever i change it to works instead and persists. this may be out of bounds for discussion here, I suppose i should go check the Apple Seed chat about this part.

11 REPLIES 11

nessts
Valued Contributor II

I tried the distributing the com.apple.LaunchServices.plist file as well and it did not do anything either.

JeremyL
New Contributor III
New Contributor III

I'm with you every step of the way here - com.apple.LaunchServices.plist gets set properly when installing as a DMG with FEU and FUT, also tried with Configuration Profiles yet links still open in Safari.

Just wondering if you ever found a solution

mike_pinto
New Contributor III

I've actually just implemented this (com.apple.LaunchServices.plist with MCX) in our environment with all clients on 10.9 without issue. Although, we do not use Casper for managed preferences.

bentoms
Release Candidate Programs Tester

We use Duti for this (http://duti.org), last month 1.5.3 was released with 10.10 support.

JeremyL
New Contributor III
New Contributor III

Now if only I could figure out how to use Duti. I was able to get somewhere with the instructions here (http://www.chainsawonatireswing.com/2012/09/19/changing-default-applications-on-a-mac-using-the-command-line-then-a-shell-script/) but still haven't completely figured it out.

Since Duti requires Xcode and command line tools I'm assuming this means those would also need to be on the client machines? I'm so confused. Any nudge in the right direction would be helpful.

daz_wallace
Contributor III

Hi @jlogsdon

I've used 'deafultbrowser' (https://github.com/kerma/defaultbrowser) and this seems to work fine. Simple run the binary with "-set [browser]" to do the work. Use "safari", "chrome" or "firefox" to set that browser.

One thing I did find is seemingly a new feature in 10.10.x, if you use either this or Duti to change the default browser, the user is prompted with a GUI message to accept the change.

This seems to be some sort of default app hijack prevention but might mean you can't be as silent as you might otherwise want to be.

Hope that helps!

Darren

nessts
Valued Contributor II

@bentoms do you just use this as a LaunchAgent and have each user run it at login and or watch for changes to the LaunchServices plist.
Works nicely on 10.9.5 but as @daz_dar says on 10.10 it asks if users want to keep safari, which is probably not going to help.
@jlogsdon read the README in the tar file, you need xcode to compile it, but once compiled there are some nice examples in the README. Then you copy the binary you compile to all of the machines you want to manage and I am guessing have a launchagent that runs as the user set it via a script.

bentoms
Release Candidate Programs Tester

@nessts, we've been running it as a Launch Agent.

Haven't put 10.10.x in prod, but in testing didn't see the pop up that @daz_dar mentioned.

@daz_dar, does the popup occur when setting the browser via a launch agent or via a policy?

daz_wallace
Contributor III

it was just running the binary in the command line to test before chucking it in a policy.

As it didn't meet our needs (with the pop up) we didn't go any further with testing.

I think running it as root didn't show the pop up but I think it also didn't set the default web browser. My thoughts were that's because it was run as root, therefore making the changes to root.

However would be handy if I was incorrect in that theory!

bentoms
Release Candidate Programs Tester

@daz_dar, well one of us will be wrong. I'm double check when looking at YoYo again.

Maybe I didn't see it as I was setting the browser to Safari & it was already set to Safari??

daz_wallace
Contributor III

Or possibly I hit the first snag and didn't test further.

Likelihood is that you're right! :)