From 9f3f72cbef981099e4be15a0d1da8246304be83d Mon Sep 17 00:00:00 2001 From: gwarser Date: Tue, 5 Jan 2021 23:54:58 +0100 Subject: [PATCH] Add support for admin-managed hidden settings (low effort) --- Deploying-uBlock-Origin.md | 67 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/Deploying-uBlock-Origin.md b/Deploying-uBlock-Origin.md index f8d879b..66b8192 100644 --- a/Deploying-uBlock-Origin.md +++ b/Deploying-uBlock-Origin.md @@ -7,6 +7,73 @@ I do not know much about that administrator stuff, so I will let a knowledgeable Administrators can force specific configurations to deployed uBlock Origin ("uBO"). At launch time, uBO will look for a setting named `adminSettings`, and if it exists, it will parse, extract and overwrite a user's settings with the administrator-assigned ones. +After [1.32.5b5](https://github.com/gorhill/uBlock/commit/c1130ec8438da5fcc1a0d552ae42328d3102dcc6), new configuration options are available: + +- `toSet`, which allow to + - override default [Trusted sites](./Dashboard:-Trusted-sites) list by `trustedSiteDirectives` array of strings + - override and lock modification of [Advanced settings](./Advanced-settings) by `hiddenSettings` array of `["name", "value"]` array of strings +- `toAdd`, which allow to append additional directives to + - [Trusted sites](./Dashboard:-Trusted-sites) list by `trustedSiteDirectives` array of strings + +Description based on [Managed storage manifest](https://github.com/gorhill/uBlock/blob/master/platform/chromium/managed_storage.json). + +
+Sample configuration + +- `adminSettings` enables uBlock annoyances list besides default ones +- `toSet` locks uBO popup panel operation to big blue power button only and permanently displays version info in `hiddenSettings` and sets `example.com` as one of the default trusted sites in `trustedSiteDirectives` +- `toAdd` appends `example.org` and `example.local` to Trusted sites by `trustedSiteDirectives`. + +```json +{ + "name": "uBlock0@raymondhill.net", + "description": "ignored", + "type": "storage", + "data": + { + "adminSettings": + { + "selectedFilterLists": + [ + "user-filters", "ublock-filters", "ublock-badware", "ublock-privacy", "ublock-abuse", "ublock-unbreak", "easylist", "easyprivacy", "urlhaus-1", "ublock-annoyances", "plowe-0" + ] + }, + "toSet": + { + "hiddenSettings": + [ + ["popupPanelDisabledSections", "28"], + ["popupPanelLockedSections", "32"] + ], + "trustedSiteDirectives": + [ + "about-scheme", + "chrome-extension-scheme", + "chrome-scheme", + "edge-scheme", + "moz-extension-scheme", + "opera-scheme", + "vivaldi-scheme", + "wyciwyg-scheme", + "example.com" + ] + }, + "toAdd": + { + "trustedSiteDirectives": + [ + "example.org", "example.local" + ] + } + } +} + +``` + +
+ +*** + New standalone settings are being added as per demand, see ["Deploying uBlock Origin: configuration"](./Deploying-uBlock-Origin:-configuration). For **Firefox**, refer to Mozilla documentation about ["Native manifests"](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_manifests) (sections about ["Managed storage manifests"](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_manifests#Managed_storage_manifests) and [its location](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_manifests#Manifest_location)). You can also consult [this specific comment](https://github.com/gorhill/uBlock/issues/2986#issuecomment-364035002) in uBO issue tracker.