Chrome Preferences

ktaylor25
New Contributor II

Hello. I've done a lot of searching on this, but I haven't found a solution. I feel like this is something that should be easy, but thus far that has not been the case.

All I want to do is set user preferences for Google Chrome, so that when a user opens Chrome for the first time, they don't see the first run prompts, and it takes them to our homepage. I also DO want the users to be able to change the homepage/preferences if they want to. I've seen a lot of suggestions, and I've tried several of them, with inconsistent results. So I figured, okay, I'll just use snapshots. But now I'm getting permission issues and I'm not exactly sure how to solve it. I recently took/passed the CCA, but I am still fairly new to this stuff.

So, I'm using Composer. I take the before snapshot, install/configure chrome, then take the after snapshot. Once the second snapshot is finished, I tried just leaving permissions alone, build as .dmg, and enable FUT. This results in an error message, something along the lines of "Chrome cannot read/write to its data directory."

So I made the package again, and this time selected the Users folder (within Composer) and applied permissions to [user] and all enclosed folders. Build as .dmg and enable FUT. This results in Chrome just crashing immediately with no error message at all. I also tried making two different packages.. one for Google Chrome.app, and one for the preference files.. but I still get the same permission issues. I guess I don't understand how these permissions are supposed to be set for user preferences. Can someone help me out?

Thanks in advance!

2 ACCEPTED SOLUTIONS

msnowdon
Contributor

I just recently researched this as well. Through several different posts and Chrome documentation, this is what Ive come up with. There are Preferences and there are Policies. If it's a setting you want users to be able to change, you want to use Preferences.

Preferences:
• Keep state of a user's personal browsing experience. • Are usually unique to each user.
• Are writable by the user, as they live in the user's directory in a text file.
• Are often under-the-hood, technical settings that don't necessarily make sense to pre-set per user or lock in with policy.
• Use the master_preferences file as a template if no Preferences already exist. Preferences get copied from master_preferences only once and are not editable after!

Preferences are kept in a file named "Preferences", which every Chromium / Google Chrome user will have in their own user directory. This Preferences file is just a text file that contains JSON markup. Going through and editing every user's Preferences file to deploy a behavior change is really cumbersome, so there are easier ways to manage this:
• When users start Chromium / Google Chrome for the first time, they don't yet have any Preferences file. • A file named "master_preferences" is used as a template for what becomes users' Preferences file. This file is placed at /Library/Google/
• You only need to create and populate the master_preferences file when you deploy Google Chrome, and all users on that machine will get those settings when they first start Chromium / Google Chrome.
The master_preferences file, like each user's Preferences file, is simply a text file that contains JSON markup.

Steps to Create a Preferences File:
• Create a JSON text file with all your preferences
• Name the preference file: master_preferences
• Test the file at http://jsonlint.com/ to verity it.
• Place the file at /Library/Google
• All users on that machine will get those settings when they first start Chromium / Google Chrome.

As far as I know, this only works for users who have not logged in yet. If they already logged into a particuliar machine, their preference file has already been created.

View solution in original post

msnowdon
Contributor

This is the post I found most of my information. Its a really good discussion:

https://www.jamf.com/jamf-nation/discussions/13947/configuring-google-chrome

View solution in original post

7 REPLIES 7

daz_wallace
Contributor III
Contributor III

Hi @KTaylor

Firstly, (my opinion) I strongly advise against using Snapshot packaging for anything other than to find out what files change, and to action the results appropriately. It's normally not a good idea to use this for packaging and deploying software except in the rarest of circumstances.

For your specific issue, I used to use the script I've written about here, but have since found that the latest versions of Chrome have broken it.
On the advice of many Mac Admins, I've now switched to the use of Configuration Profiles to manage this, as detailed here. I've yet to full test it, but you may be able to use a 'Set-Once' profile in order to configure the options you're after.

Good Luck, and I hope that helps!

Darren

conor
New Contributor III

You can try editing the chrome-defaults.preferences file. Thats what we did, and then run this as a post install script policy.

msnowdon
Contributor

I just recently researched this as well. Through several different posts and Chrome documentation, this is what Ive come up with. There are Preferences and there are Policies. If it's a setting you want users to be able to change, you want to use Preferences.

Preferences:
• Keep state of a user's personal browsing experience. • Are usually unique to each user.
• Are writable by the user, as they live in the user's directory in a text file.
• Are often under-the-hood, technical settings that don't necessarily make sense to pre-set per user or lock in with policy.
• Use the master_preferences file as a template if no Preferences already exist. Preferences get copied from master_preferences only once and are not editable after!

Preferences are kept in a file named "Preferences", which every Chromium / Google Chrome user will have in their own user directory. This Preferences file is just a text file that contains JSON markup. Going through and editing every user's Preferences file to deploy a behavior change is really cumbersome, so there are easier ways to manage this:
• When users start Chromium / Google Chrome for the first time, they don't yet have any Preferences file. • A file named "master_preferences" is used as a template for what becomes users' Preferences file. This file is placed at /Library/Google/
• You only need to create and populate the master_preferences file when you deploy Google Chrome, and all users on that machine will get those settings when they first start Chromium / Google Chrome.
The master_preferences file, like each user's Preferences file, is simply a text file that contains JSON markup.

Steps to Create a Preferences File:
• Create a JSON text file with all your preferences
• Name the preference file: master_preferences
• Test the file at http://jsonlint.com/ to verity it.
• Place the file at /Library/Google
• All users on that machine will get those settings when they first start Chromium / Google Chrome.

As far as I know, this only works for users who have not logged in yet. If they already logged into a particuliar machine, their preference file has already been created.

ktaylor25
New Contributor II

@msnowdon - Thanks for the info. I'll give this a try. Does the JSON file need a particular extension? Or is it okay to just be a basic text file?

conor
New Contributor III

The JSON file is just a simple text file, no extensions needed

msnowdon
Contributor

For my needs, I ended up using the com.google.Chrome.manifest file, which is an xml file. I tweaked it and uploaded as a Configuration Profile. This is considered a policy though and users cannot make changes to the settings.

msnowdon
Contributor

This is the post I found most of my information. Its a really good discussion:

https://www.jamf.com/jamf-nation/discussions/13947/configuring-google-chrome