New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 676540 link

Starred by 10 users

Issue metadata

Status: Archived
Owner:
Closed: Dec 13
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 1
Type: Bug


Show other hotlists

Hotlists containing this issue:
Chrome-Bug-Cleanup


Sign in to add a comment

Unnable to apply master_preferences to newly installed Chrome browser on OS X

Project Member Reported by soushi@chromium.org, Dec 22 2016

Issue description

- Was tested with current Chrome browser released channels: 
Chrome Stable 55.0.2883.96
Chrome Beta 55.0.2883.75
Chrome Dev 56.0.2924.18
Chrome Canary 57.0.2944.0

- Platform
OS 10.10.x Yosemite
OS 10.11.x El Capitan

- Issue description
Enterprise customer needs to set Google Chrome as users' default browser. After the installation, they created "/Library/Google/Google Chrome Master Preferences" file and launched C.Browser (the first launch). Even though the preference file was copied to "~/Library/Application Support/Google/Chrome/Default/Preferences" and they confirmed the content is valid, when customer checks "chrome://settings" shows Default Browser: it still says "Google Chrome is not currently your default browser" which is the way he is using to confirm that the preferences are not being applied.

- Reproduce step
** Tested this with a new machine that doesn't have Google Chrome installed yet. Unfortunately it is still not setting Chrome as the default browser. **

1. Install Chrome on a new machine.
2. Google Chrome was installed but didn't launch.
3. Create “master_preferences” file, and then rename it to “Google Chrome Master Preferences” (without extension .txt). Then, Move it to /Library/Google/ folder. (Actually the "/Library/Google" folder doesn't exist on the device, so customer created it under the "/Library" folder manually.

[Customer's "Google Chrome Master Preferences" file]
https://drive.google.com/a/google.com/file/d/0B8hJbBKk0-c4SzNuRXVWRFl5dkU/view?usp=sharing
Note: Confirmed that the file name and the format is valid.
ref. https://www.chromium.org/administrators/configuring-other-preferences

4. Launch Chrome (This is the 1st time launching)
5. Confirmed that the "~/Library/Application Support/Google/Chrome/Default/Preferences" file exists. The file has "make_chrome_default": true and "make_chrome_default_for_user": true plus many more other settings are same as the master preference file they created on step 3. 
6. Confirmed that chrome://policy shows "No policies set"
7. Goto "chrome://settings" shows Default Browser: it still says "Google Chrome is not currently your default browser". < this is the issue.

- Related issues
This issue might be duplicated to  crbug.com/263803 , but it is mainly used for Windows environment and hasn't updated since Jul.

- Customer's "Google Chrome Master Preferences" file
https://drive.google.com/a/google.com/file/d/0B8hJbBKk0-c4SzNuRXVWRFl5dkU/view?usp=sharing
 
Cc: blumberg@chromium.org
Owner: georgesak@chromium.org
Labels: TE-NeedsTriageHelp
Cc: rsesek@chromium.org rdevlin....@chromium.org jawag@chromium.org
Was this part of the settings hardening fixes?

Comment 4 by soushi@chromium.org, Jan 11 2017

@georgesak

Friendly ping. Our enterprise customer reported they cannot set Chrome browser as their default browser, as using master_preferences is the only way to do that on OS X. (we don't have the policy yet.)
As it might be a wide-spread issue for Chrome deployment on OS X, I would be grateful if you could prioritize this issue. Thanks!

Comment 5 by jawag@chromium.org, Jan 11 2017

Cc: privard@chromium.org robertshield@chromium.org
+privard, robertshield to comment on #3
Cc: pinkerton@chromium.org
Cc: shrike@chromium.org
+shrike

How is this done on windows? I'm trying to understand if this is a bug with the settings hardening (ie, this is the correct practice but it's now broken) or if there is something else they should be doing.
Cc: grt@chromium.org
Settings hardening isn't currently enabled on Mac, so while possible I doubt it's that. 

I don't know much about how master_preferences get loaded on Mac, Greg might.
Ok, poked at this a bit, the only Mac-specific code seems to be in looking up the master preferences file here (https://codesearch.chromium.org/chromium/src/chrome/browser/mac/master_prefs.mm). 

The rest (https://codesearch.chromium.org/chromium/src/chrome/browser/first_run/first_run.cc?rcl=0&l=467) looks like it uses the same preferences loading code as on Windows, so.. in theory it should work there too. I don't have a Mac dev environment set up to step through, but I don't see any obvious platform-specific preferences changes that would break this only on Mac. 

Comment 10 by grt@chromium.org, Jan 11 2017

I have nothing to add beyond what Robert said. It looks like SetAsDefaultBrowser in shell_integration_mac.mm should be getting called by first_run.cc's ProcessDefaultBrowserPolicy. Note that this is only for users going through first-run.
Cc: ligim...@chromium.org
Labels: -TE-NeedsTriageHelp
Status: Assigned (was: Unconfirmed)
Assigning to George for further updates.
Hi team,

Are there any updates here?. 

Thanks in advance.
Labels: Restrict-View-Google
Added RVG as there are links of cs.

I received update request from the customer.

There are 3 calls from SetAsDefaultBrowser().
https://codesearch.chromium.org/chromium/src/chrome/browser/shell_integration_mac.mm?rcl=c88786898b6f37bf802e1db5aee843f3b27c1627&l=55

1. 'if (!CanSetAsDefaultBrowser())'
CanSetAsDefaultBrowser() will return SET_DEFAULT_UNATTENDED when the browser isn't Canary. Thus, it will be always 'false'.
https://codesearch.chromium.org/chromium/src/chrome/browser/shell_integration_mac.mm?rcl=c88786898b6f37bf802e1db5aee843f3b27c1627&l=92

2. NSString* identifier = [base::mac::OuterBundle() bundleIdentifier];
'base::mac::OuterBundle()' won't return nil, because at least, it will return [NSBundle mainBundle].
https://codesearch.chromium.org/chromium/src/base/mac/bundle_locations.mm?rcl=c88786898b6f37bf802e1db5aee843f3b27c1627&l=28

Need to check if bundleIdentifier is nil.
https://codesearch.chromium.org/chromium/src/build/config/mac/BuildInfo.plist?rcl=c88786898b6f37bf802e1db5aee843f3b27c1627&l=21

3. [[NSWorkspace sharedWorkspace] setDefaultBrowserWithIdentifier:identifier];
'setDefaultBrowserWithIdentifier' is defined as extension in NSWorkspace+Utils.h.
The "NSWorkspace+Utils.h" is loaded by #import instead of #include. Need to check if it is loaded properly.
https://codesearch.chromium.org/chromium/src/chrome/browser/shell_integration_mac.mm?rcl=c88786898b6f37bf802e1db5aee843f3b27c1627&l=12
Labels: -Restrict-View-Google
soushi: Chromium is open source.
Friendly bump.

Do you guys need any specific info that we might provide?

This looks like a change in the OS that prevents us from silently changing the default browser. From OS X 10.10 and on, trying to change the browser results in a popup that explicitly asks the user to validate the change.

@1: Does the first run trigger that popup or nothing at all?
Hello!
This bug is receiving this notice because there has been no acknowledgment of its existence in quite a bit of time
- If you are currently working on this bug, please provide an update.
- If you are currently affected by this bug, please update with your current symptoms and relevant logs.

If there has been no updates provided by EOD Wednesday, 12/12/18 (5pm EST), this bug will be archived and can be re-opened at any time deemed necessary.

Thank you!
Status: Archived (was: Assigned)
Due to lack of action this bug has been Archived. If work is still being done on this issue or you are still experiencing this issue please feel free to re-open with the appropriate information.

Sign in to add a comment