Chrome PList for Notifications

New Contributor II

Hello! I ran into an issue where a user received malicious notifications (luckily didn't click on them) through Chrome. I was able to direct her to the Chrome settings location to remove the sites causing the notifications. Does anyone know if there is a way to set allowed site notifications and block the rest from being changed via a Chrome configuration file?


Contributor III

Here is the reference you want to look at:

New Contributor III

To add on what rqomsiya is referring to, is that you will want to deploy a MDM policy that has the key of NotificationsAllowedForUrls and the value will be an array of strings (URLs). This can also be applied as a preference list in /Library/Preferences/ by running the following command as root:

defaults write /Library/Preferences/com.Google.Chrome.plist '{NotificationsAllowedForUrls = ( "[]", "[]" );}'

In the example above, the array of strings are quoted and separated by a comma between the pair of parenthesis.

You can confirm the contents of the file by converting it to plaintext with plutil and reading the contents of the file with cat:

plutil -convert xml1 /Library/Preferences/com.Google.Chrome.plist

cat /Library/Preferences/com.Google.Chrome.plist

You should see output similar to this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
        <string> [*]</string>
        <string> [*]</string>