Chrome PList for Notifications

jhart_hv
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?

2 REPLIES 2

rqomsiya
Contributor III

Here is the reference you want to look at:

https://www.chromium.org/administrators/policy-list-3#NotificationsAllowedForUrls

zanb
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 = ( "[].domain1.com", "[].domain2.com" );}'

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" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NotificationsAllowedForUrls</key>
    <array>
        <string> [*].domain1.com</string>
        <string> [*].domain2.com</string>
    </array>
</dict>
</plist>