3

We have several hundred MacBooks on campus, all managed by us. We're hoping to find an easy(ish) way of setting the homepage across all of them, all at once. The catch is, there are a variety of flavours of browser in use - some users like Firefox, some Safari, some Chrome. The Macs are running a mixture of 10.6 and 10.7.

Safari is pretty easy to do: defaults write com.apple.Safari HomePage http://www.newhomepage.com

Firefox is also fairly easy, using a user.js file in their profile directory - however, that profile resides in ~/Library/Application Support/Firefox/Profiles/xxxxxx.default, where xxxxxx is a random, six-digit string. We can't work out a way to easily place user.js into each user's profile.

Google Chrome is an odd one - ~/Library/Application Support/Google/Chrome/Default/Preferences seems to be where the homepage string resides - However I don't really want to just drop a whole new preferences file in there, as this will reset other settings that the user has.

Does anyone know of a way to set the homepage easily across all three browsers, all at once? Ideally we'd be able to create a .pkg and deploy it.

thankyou for your assistance!

2 Answers 2

1

Two ways to set this up on Chrome:

  1. Set MCX preferences using the Workgroup Manager to configure the RestoreOnStartupURLs policy. See http://www.chromium.org/administrators/policy-list-3#RestoreOnStartup.
  2. Set a master preferences file with the desired homepage/startup URLs, and it will be automatically imported for new chrome profiles.

More details on both solution at http://www.chromium.org/administrators.

0

I don't know if sed and grep behaves the same way in Linux and MacOS, but let's try.

For Chrome you can do that using sed:

sed -i ~/Library/Application Support/Google/Chrome/Default/Preferences -e 's/"homepage"*/"homepage": "www.newhomepage.com"/'

For Firefox, you can use the same trick:

USERDIR=`grep 'Path' profiles.ini | cut -d'=' -f2`
sed -i $USERDIR -e 's/user_pref("browser.startup.homepage".*,user_pref("browser.startup.homepage", "http://www.newhomepage.com");/'

And for Safari you already did it.

You must log in to answer this question.

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