Welcome to EdListen:
Never Stop Learning

How to Globally Manage Whitelists and Settings with uBlock Origin

Ads can be very distracting to students, or any user for that matter, and one way to prevent this distraction is to use an add-blocker extensions like AdBlock Plus or uBlock Origin.  While these tools do work well, they can sometimes cause legitimate websites not to load properly.   So while it may seem like a simple plan to just distribute an add-blocker out to the students, without the ability to globally manage a white-list of sites for them it could cause some real issues.

After doing some research we figured out that uBlock Origin has the ability to do just that; manage settings globally.   The process is a bit clunky but it is possible.   

The below research and instructions were created by a co-worker of mine, and I cannot take any credit for them.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Easiest way to begin making a change you want distributed to a group is to export the general settings currently setup in uBlock here (Backup to file):
You will get a text file containing all the parameters that can be changed within the extension. Once you’ve decided what it is you’d like to push out as a group policy setting, remove all entries from the exported settings file that do not pertain to the change(s) you have in mind. Once you’ve edited the settings as you find necessary, run the contents through a JSON validator to make sure the syntax is correct. I’ve found it is incredibly touchy: the difference between my initial whitelist setting working and not working was properly placed double forward slashes, instead of single ones.
In our case we initially looked to see how easy it would be to edit the whitelist remotely, making us able to easily add sites that uBlock may block crucial content on (this doesn’t appear to happen very often but being able to adapt as such is necessary). Here is a short example of an edited whitelist:
{"adminSettings": {"Value": "{ \"netWhitelist\": \"about-scheme\\nbehind-the-scene\\nchrome-extension-scheme\\nchrome-scheme\\nloopconversation.about-scheme\\nopera-scheme\\nforbes.com\\nespn.go.com\\nfhuhs.org\" }"}}
As you can see, only the \”netWhitelist\” value remains from the exported settings, and it is nested within adminSettings and Value parameters, which were added afterward, based on guidance found from a github thread (hopefully this is still hosted if we need it again). The \\n separates each page/domain from one another within the whitelist (forbes/espn/fhuhs added, all the others are default chromeOS settings pages)
Once you’ve readied your JSON text file for distribution, you can navigate to uBlock’s app management within the google admin console as such:
Head to device management
Click Chrome Management in the left-hand pane
Click on app management
Search for uBlock and click on the proper extension (there are different versions of uBlock)
Click on User settings (to open up what you see below) and navigate to the user OU to which you’d like to distribute the policy
If you’ve already pushed the extension out to that OU, or to a higher one from which it inherits that setting, force installation will already be turned on, but if it isn’t do that now. Under the second arrow is where the configuration file goes. If there isn’t one applied there will be a large Upload Configuration File button here; if there already is, there will be, as pictured, a view button to get a basic look at the JSON text file you’ve already uploaded for distribution, an X to remove that file, and save/cancel settings below to finalize your decision.
Here is working JSON text for a policy to disable the block element context menu option as well as push out four domains to the whitelist (fhuhs, forbes, espn, abc):
{
        "adminSettings": {
                "Value": "{ \"userSettings\": {\"contextMenuEnabled\": false }, \"netWhitelist\": \"about-scheme\\nbehind-the-scene\\nchrome-extension-scheme\\nchrome-scheme\\nloopconversation.about-scheme\\nopera-scheme\\nforbes.com\\nespn.go.com\\nfhuhs.org\\nabc.com\" }"
        }
}