uBlock Whitelist Preference via Configuration Profile

russeller
Contributor III

We use com.google.Chrome in a user-level configuration profile to force install the uBlock extension in Chrome. This has been working great. We are running into issues in our K-12 where staff and students are complaining about some content being blocked by uBlock that is causing issues. We created a github page with a text file on it that is our whitelist so we can update it quickly if needed. We got this to work on our windows machines via Group Policy by following these directions

Those instructions have a portion about creating a plist for setting the extension policies, which I did like this:

filename: com.google.Chrome.extensions.cjpalhdlnbpafiamejdnhcphjbkeiagm.plist

<?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>adminSettings</key>
    <string>{"userSettings":{"autoUpdate":true,"externalLists":"https://raw.githubusercontent.com/BSD-IT/uBlockWhitelist/master/bsdwhitelist.txt"},"selectedFilterLists":["plowe-0","malware-1","malware-0","easyprivacy","easylist","ublock-unbreak","ublock-privacy","ublock-badware","ublock-filters","user-filters","https://raw.githubusercontent.com/BSD-IT/uBlockWhitelist/master/bsdwhitelist.txt"]}</string>
</dict>
</plist>

I basically put the JSON data in there by backing up my uBlock settings from the extension and placing it here. I then uploaded this plist to the JSS as a user-level Configuration Profile, then I downloaded it to test it out (installing it locally) and it installs, it just appears that uBlock isn't reading the preferences. I'm not sure where to go from here. Since all the extension settings are stored inside the users Chrome profiles I didn't want to mess with those directly.

Thanks

1 ACCEPTED SOLUTION

nkalister
Valued Contributor

huh, what a coincidence . . . .we just deployed ublock with a configuration profile that tells the extension to use a whitelist from our company server.
I found that the uBlock extension was really strange about how it wanted the adminSettings value formatted. To get it to work in my profile, I had to add a blank line in-between <key>adminSettings</key> and the <string> containing the settings, and it didn't seem to like whitespace around that string, either, so I popped it out of the XML indenting.
Also, I constructed my profile from an MCX preference file using MCXToProfile . . .

Here's a link to a gist of my profile

View solution in original post

2 REPLIES 2

nkalister
Valued Contributor

huh, what a coincidence . . . .we just deployed ublock with a configuration profile that tells the extension to use a whitelist from our company server.
I found that the uBlock extension was really strange about how it wanted the adminSettings value formatted. To get it to work in my profile, I had to add a blank line in-between <key>adminSettings</key> and the <string> containing the settings, and it didn't seem to like whitespace around that string, either, so I popped it out of the XML indenting.
Also, I constructed my profile from an MCX preference file using MCXToProfile . . .

Here's a link to a gist of my profile

russeller
Contributor III

@nkalister Thank you so much! This pointed me in the right direction. The biggest problem is somehow I got the com.google.Chrome.extensions.xxx key in the plist itself which shouldn't have been there. I'm going to edit my original question incase someone else comes along looking for this. I also was trying to apply it as a user profile, and it worked as a system profile. Thanks again.