Manage Firefox and Chrome Home Page via Config Profile

stevewood
Honored Contributor II
Honored Contributor II

I'm looking for a method of managing the home page setting in both Firefox and Chrome via Configuration Profile. I know for Firefox this can be managed using CCK2 to generate an autoconfig.zip file and then an AutoPkg recipe to create a Firefox installer, and Chrome can be managed with the Chrome Managed Preferences, although only on initial launch.

We need to manage this setting for all users of a machine, regardless if they have launched the browsers or not. The preference needs to be locked so that the users are unable to change the setting. Thus the reason for trying to do this via Config Profile and not just a defaults write or some other thing.

Any ideas?

8 REPLIES 8

golbiga
Contributor III
Contributor III

Steve,

Chrome can definitely set the homepage via a Config Profile, see an example here, look for HomepageLocation. I found this for Firefox, but honestly I've just used CCK2 for that. Also that profile is 4 years old now so Im not sure it'll even work.

Hope this helps,
Allen

stevewood
Honored Contributor II
Honored Contributor II

@golbiga Yeah, I found that profile on someone else's GitHub, and after testing it doesn't appear to work anymore. Not sure why Google can't behave properly in this instance. And yeah, I found @nmcspadden Firefox profile (might have been his Chrome one too), and that didn't seem to work, but I'll test it some more. And I'm with you, CCK2 all the way, but I don't really want to re-deploy Firefox to a fleet of 400 Macs just because I need to set the home page. Unless you know a way to apply CCK2 to an existing Firefox install without breaking things.

Thanks Allen!

golbiga
Contributor III
Contributor III

@stevewood thats weird. I'm pretty sure I tested the chrome settings the other day. I'll double-check in the AM. I'll have to check on CCK2 as well, sorry for not having a better answer.

Allen

RobertHammen
Valued Contributor II

@stevewood I'm re-deploying Firefox + CCK2 to ~240 Macs... so I feel your pain. Might just be the easiest way.

kmitnick
New Contributor III

@stevewood I was just doing something similar to what you need today. I got a profile that will set the Google Chrome Homepage and a few other items. I also wrote a script that will set the Firefox homepage ONLY and NOT mess up any existing settings. The only caveat is Firefox needs to be launched once for it to work because it modifies the prefs.js file for the current logged in user. See code below. If the code gets mangled by this post, I can email you the .sh file. I cannot attach the profile to this thread but I can post the xml. Again, I can email you both if they get mangled by this post. Feel free to edit to your needs and pay it forward should you make it better. Firefox script first.

Hope this helps.

Keith

!/bin/bash

This will get the curretly logged in user.

loggedinuser=python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + " ");'

This will change the firefox homepage

echo "user_pref("browser.startup.homepage", "http://yourhomepagehere.com");" >> /Users/"$loggedinuser"/Library/Application Support/Firefox/Profiles/*/prefs.js

This is the Google Chrome profile copy it and save it as a .mobileconfig file.

<?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>PayloadContent</key> <array> <dict> <key>PayloadContent</key> <dict> <key>com.google.Chrome</key> <dict> <key>Forced</key> <array> <dict> <key>mcx_preference_settings</key> <dict> <key>DefaultBrowserSettingEnabled</key> <false/> <key>ShowHomeButton</key> <true/> <key>DefaultNotificationsSetting</key> <integer>2</integer> <key>HideWebStorePromo</key> <true/> <key>DeviceAutoUpdateDisabled</key> <true/> <key>ImportAutofillFormData</key> <false/> <key>ImportBookmarks</key> <false/> <key>ImportHistory</key> <false/> <key>ImportHomepage</key> <false/> <key>ImportSearchEngine</key> <false/> <key>WelcomePageOnOSUpgradeEnabled</key> <false/> <key>ProxyMode</key> <string>system</string> <key>HomepageLocation</key> <string>http://yourhomepagehere.com</string> <key>RestoreOnStartup</key> <integer>4</integer> <key>RestoreOnStartupURLs</key> <array> <string>http://yourhomepagehere.com</string> </array> <key>ImportSavedPasswords</key> <false/> <key>ImportSearchEngine</key> <false/> <key>MetricsReportingEnabled</key> <false/> </dict> </dict> </array> </dict> </dict> <key>PayloadDisplayName</key> <string>Chrome Defaults</string> <key>PayloadEnabled</key> <true/> <key>PayloadIdentifier</key> <string>com.apple.ManagedClient.preferences.41E03AA0-E8D7-4F39-867B-49DE0B9F4674</string> <key>PayloadType</key> <string>com.apple.ManagedClient.preferences</string> <key>PayloadUUID</key> <string>41E03AA0-E8D7-4F39-867B-49DE0B9F4674</string> <key>PayloadVersion</key> <integer>1</integer> </dict> </array> <key>PayloadDisplayName</key> <string>Google Chrome - forced settings</string> <key>PayloadIdentifier</key> <string>org.profile.chrome</string> <key>PayloadOrganization</key> <string>Abrams Books</string> <key>PayloadRemovalDisallowed</key> <true/> <key>PayloadScope</key> <string>System</string> <key>PayloadType</key> <string>Configuration</string> <key>PayloadUUID</key> <string>D9A7B5E6-45A8-46A6-8E34-A37C0B4CA5A3</string> <key>PayloadVersion</key> <integer>1</integer>
</dict>
</plist>

stevewood
Honored Contributor II
Honored Contributor II

@kmitnick @golbiga @RobertHammen

So I came home and took another look at this. Apparently I must have been messing something up earlier when testing the Chrome profiles, because now I can get them to work (the one Keith sent and the one Allen linked to). I was editing out a lot of the stuff in them and perhaps I messed something up. I'll have to play around with it more tomorrow.

As for Firefox, the profiles that are up on @nmcspadden GitHub do not seem to work. No biggie there as I can use the script snippet Keith sent, or as a last resort use CCK2 to package up a new version of Firefox and deploy that.

Thanks everyone for the assist on this, and for setting my head right!

kmitnick
New Contributor III

@stevewood Glad I could assist. Keep us posted on your results.

AndreasRumpl
New Contributor III

@stevewood Regarding Google Chrome: That works just fine [https://www.jamf.com/jamf-nation/discussions/23233/google-chrome-homepage](link URL)