Has anyone had any luck finding a way to make Chrome the default browser automatically for all users? We're using Catalina (10.15). The closest thing I have been able to do is just block Safari notifications asking to be the default browser once the user switched to Chrome. Thanks!
Setting the default browser lives in the user space and Apple took control over that away years ago. 'Cause Apple. It's not impossible, but it's not easy. Some folks have had success in the past trying to use tools like launchsetter or duti but I'll be honest, that may not be easy. Check out the blog post here - https://technology.siprep.org/script-making-chrome-the-default-browser-on-macos/ - that might get you going in the right direction.
Do you have Apple Enterprise support? Ask them for an official "Apple" way and when they come back and say it can't be managed, give them proper feedback. Also - check out this post here - https://community.jamf.com/t5/jamf-pro/setting-default-browser-in-mojave-to-something-other-than-saf... - a few folks have posted a few different options, but they are a few years old, no guarantee they still work.
Hi @targendaz Thanks for the info, It helps a lot!
can you please explain a little more about the flow of distribution through Jamf (as a script),
About the msda set [-h] [-feu] [-fut] [-e EXTENSION ROLE] [-p PROTOCOL] [-u UTI ROLE] app_id
I try to set Google Chrome as the default web browser.
I created new policy, added the script (Set the JAMF variable to True in the User-Editable Settings section)
and the command -h --version Parameter 4 text in the policy.
About the Set command, Where it should be done?
msda set com.google.chrome -p http -p https -u public.url all -u public.html viewer -u public.xhtml all -fut
thank you for sharing, @targendaz!
That's what I've been looking for.
it works wonderfully on macos 11.5.1 & M1 and 11.4.0 & Intel.
I put the script in the same policy as the Google Chrome Self Service Installation.
Parameter 4 is: set com.google.chrome -p http -p https -p mailto -u public.url all -u public.html viewer -u public.xhtml all -fut
Hi we solved this. We realized we just needed to install the .pkg for MSDA and then run the "msda set" commands to set the defaults. We added postinstall script to our .pkg to facilitate installing and setting defaults in one package.
However in Mosyle - the install PKG feature only works for PKG's that have a .app file in them (the msda .pkg only has a .py python text file)
So we had to install the .pkg via a custom command in Mosyle using curl to download the .pkg from the Mosyle CDN. We also had to enable variables for the custom command profile and add the variable for the .pkg file in the Mosyle CDN - as Mosyle download URLs expire after 24 hours unless their file variable is used. Here is our command:
#please visit https://github.com/targendaz2/Mac-Set-Default-Apps for updated packages and manually upload future updates to Mosyle CDN
#changes into the temporary folder
#downloads package from Mosyle CDN using their specific variable for the file
curl -L --silent -o /tmp/MacSetDefaultAppsv1.3.1.pkg "%MosyleCDNFile:b1ac25f7-4744-417d-a787-11d572063438%"
#installs the package
installer -allowUntrusted -pkg /tmp/MacSetDefaultAppsv1.3.1.pkg -target /
#removes the package after installation
rm -rf MacSetDefaultAppsv1.3.1.pkg
#Set default apps after install
/usr/local/bin/msda set com.google.chrome -p http -p https -p mailto -u public.url all -u public.html viewer -u public.xhtml all -fut
/usr/local/bin/msda set com.adobe.reader -u com.adobe.pdf all
Another update to our update - running the script above produced a macOS warning that "MosyleMDM needs to be updated" which of course we don't want our users to see.
Running the python script as bash commands (as seen above) uses the Apple Python 2 engine which generates the warning message described. macOS 12 Monterrey is the last macOS to support Python 2.
The workaround is to embed the bash commands into the package as a postinstall script within the .pkg. Installing the python script and running the commands as postinstall uses the apple installer engine which does not generate that message.
However this of course means the .pkg file cannot be easily updated with newer versions as a postinstall customization has to be made.
This also means the script as-is will not function for future macOS 13 since it is written in Python 2.
That is our workaround for now,