Google Master Preferences

ChrisTech
Contributor

Good Morning,

I am trying to get Google Chrome Master Preferences in place. I have created the necessary file and placed it in /Library/Google/ and Chrome fails to recognize it. I made sure the file is in plain text format. Here is my file:

{
  "homepage": "http://www.mysite.org",
  "homepage_is_newtabpage": false,
  "browser": {
    "show_home_button": true,
    "check_default_browser" : false
  },
  "session" : {
    "restore_on_startup": 4,
    "startup_urls": [
      "http://www.mysite.org"
    ]
  },
  "bookmark_bar": {
    "show_on_all_tabs": true
  },
  "sync_promo": {
    "show_on_first_run_allowed": false
  },
  "distribution": {
    "ping_delay": 60,
    "suppress_first_run_bubble": true,
    "do_not_create_desktop_shortcut": true,
    "do_not_create_quick_launch_shortcut": true,
    "do_not_launch_chrome": true,
    "do_not_register_for_update_launch": true,
    "make_chrome_default": false,
    "make_chrome_default_for_user": false,
    "suppress_first_run_default_browser_prompt": true,
    "system_level": false,
    "verbose_logging": false
}
17 REPLIES 17

pblake
Contributor III

Permissions? They should match the original.

ChrisTech
Contributor

I did do a chmod 644 to the Google Chrome Master Preferences to test.. and nothing. I think something else is going on. Possibly with User Templates. I created another file with different startup tabs, and it worked. So it's reading the file but it appears something else is overriding my prefs that I am setting.

bpavlov
Honored Contributor

Google Chrome Master Preferences only works if Google has NOT been launched on that user account before. In other words, make sure no Google Chrome profile exists already on that account.

Also it can be very picky about syntax. Any little typo and you might fine it will not cooperate.

georgecm12
Contributor III

If what is included in the original post is exactly what is in the file, then you are missing a closing curly bracket.

As @bpavlov mentioned, syntax is important. Run the file through http://jsonlint.com/ to verity it.

Look
Valued Contributor III

If it is missing a bracket it will definitely fail, it's very picky about the file being exactly right!
Start with the sample they provide and make one change at a time checking after each one.

bbot
Contributor

Does this master preference file need to be a specific name and file type?

I figured out how to change the preferences for the user by scripting
sudo -u $currenetuser defaults write com.google.Chrome AuthServerWhiteList "*apple.website.com"

but now what to do this for our Mac image so that all newly imaged machines get this setting.

georgecm12
Contributor III

The file is a plain text file that must be named "Google Chrome Master Preferences" (no three-letter file type) and must be located in the /Library/Google directory. It must be a correctly formatted JSON file, so test it on http://jsonlint.com/ before implementing.

You could also manage preferences with a Configuration Profile. The difference being that the Google Chrome Master Preferences file is used only for setting default preferences on first launch, and users can then change them after that point. Configuration Profiles implement enforced preferences that users cannot change, and they apply to both new and existing Chrome users.

bbot
Contributor

Thanks @georgecm12

I created a plain text file,

added the following below and then removed the .rtf extension. Thanks for providing the link to the jsonlint -- super helpful! Time to upload this file onto our image and verify it works.

{ "AuthNegotiateDelegateWhiteList": "iwa.com", "AuthServerWhitelist": "iwa.com"
}

bbot
Contributor

Running into issues here. My syntax is passing in jsonlint.com. I'm loading the Google Chrome Master Preferences (no file extension) file to /Library/Google that looks like below and launching Chrome and the settings aren't applying. Any ideas?

{ "AuthNegotiateDelegateWhiteList": "iwa.com", "AuthServerWhitelist": "iwa.com"
}

Look
Valued Contributor III

It may not matter, butI would think generally those would be on seperate lines. Also if another item follows this the close "}" would be followed by a comma "," and the whole lot is part "browser" I think i.e something like this.

    "browser": {
    "AuthNegotiateDelegateWhitelist": "domain.com",
    "AuthServerWhitelist": "domain.com"
    },

bbot
Contributor

Still no dice. Surprised it's this complicated to set a master pref... I must be overlooking something simple

Look
Valued Contributor III

Try this exactly with absolutely nothing else included.

{
    "browser": {
    "AuthNegotiateDelegateWhitelist": "iwa.com"",
    "AuthServerWhitelist": "iwa.com"
    }
}

mscottblake
Valued Contributor

@Look Had a typo in his snippet. Try this exactly with nothing else included in the file.

{
    "browser": {
    "AuthNegotiateDelegateWhitelist": "iwa.com",
    "AuthServerWhitelist": "iwa.com"
    }
}

Also, what application are you using to modify the file? I highly recommend a real text editor like TextWrangler or Atom instead of something like TextEdit. Your file needs to be in plain text, not rich text (rtf).

bbot
Contributor

@mscottblake i tried with just textedit and textwrangler. I'll try this again tomorrow. Thanks!

mscottblake
Valued Contributor

.

winops
New Contributor

@mscottblake No dice. Copy and pasted that exactly, copied to /Library/Google on a brand new imaged Mac. Launched chrome and went to chrome://policy and saw no policies set. :(

CasperSally
Valued Contributor II

@georgecm12 thanks for the http://jsonlint.com tip ! helped me out.