From d00c0861c6e0079d33ad856e69218825af6b5983 Mon Sep 17 00:00:00 2001 From: blue Date: Mon, 21 Mar 2022 22:12:16 +0000 Subject: [PATCH 1/6] Add Group Policy template for MS Edge Policies for all available managed storage settings, documentation from the wiki, and usage examples. --- tools/GroupPolicy/en-US/uBlock.adml | 126 ++++++++++++++++++++++++++++ tools/GroupPolicy/uBlock.admx | 67 +++++++++++++++ 2 files changed, 193 insertions(+) create mode 100644 tools/GroupPolicy/en-US/uBlock.adml create mode 100644 tools/GroupPolicy/uBlock.admx diff --git a/tools/GroupPolicy/en-US/uBlock.adml b/tools/GroupPolicy/en-US/uBlock.adml new file mode 100644 index 0000000000000..c8b672c3cad24 --- /dev/null +++ b/tools/GroupPolicy/en-US/uBlock.adml @@ -0,0 +1,126 @@ + + + Contoso Company base file + This file contains the Contoso parent category. + + + + uBlock Origin v1.0.0.1 or later + uBlock Origin v1.3.2 or later + uBlock Origin v1.33.0 or later + uBlock Origin + Google Chrome + Microsoft Edge + Apply an exported configuration (adminSettings) + Advanced settings to overwrite + User settings to overwrite + Prevent access to uBO's dashboard + Popup panel parts to disable + Settings to add at launch time + Settings to overwrite at launch time + A valid JSON string compliant with uBO's backup format. + +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. + +Configure uBO as you wish for your users, then create a backup using the "Backup to file" in the Settings pane. Now open this backup file using a text editor, and remove all entries you do not want to overwrite, while taking care to end up with a valid JSON file (mind trailing commas, etc.). All the entries left are the ones which will be overwritten on the user's side. + +Example value: +{"userSettings": {"colorBlindFriendly": true}} + +https://github.com/gorhill/uBlock/wiki/Deploying-uBlock-Origin + + A list of [name,value] pairs to populate user settings + +Each entry in the array is an array consisting of a pair of name-value strings. Each name string must be a supported user setting, and each value string must properly resolve to a supported value. + +Every valid entry will be used to overwrite the corresponding default user setting at launch time. + +Example value: +[[ "contextMenuEnabled", "false" ],[ "dynamicFilteringEnabled", "false" ]] + +https://github.com/gorhill/uBlock/wiki/Deploying-uBlock-Origin:-configuration#usersettings + A list of [name,value] pairs to populate advanced settings + +Each entry in the array is an array consisting of a pair of name-value strings. Each name string must be a supported advanced setting, and each value string must properly resolve to a supported value. + +Every valid entry will be used to overwrite the corresponding default advanced setting, and will also become read-only, i.e. the user won't be able to change it. + +Example value: +[[ "disableWebAssembly", "true" ]] + +https://github.com/gorhill/uBlock/wiki/Deploying-uBlock-Origin:-configuration#advancedsettings + Set to true to prevent access to configuration options + +https://github.com/gorhill/uBlock/wiki/Deploying-uBlock-Origin:-configuration#disabledashboard + An array of strings, where each string refer to a part of the popup panel which should be removed from view. Current supported named parts: + +globalStats: remove access to "Blocked since install" statistic. +basicTools: remove access to basic tools. +extraTools: remove access to per-site switches. +overviewPane: remove access to the overview pane. + +Example value: +["globalStats","overviewPane"] + +https://github.com/gorhill/uBlock/wiki/Deploying-uBlock-Origin:-configuration#disabledpopuppanelparts + The properties in the toAdd branch will append to the already present local settings. Currently, the following properties are supported: + +trustedSiteDirectives +The trustedSiteDirectives property is an array of string, each of which must resolve into a valid trusted-site directive, used to dictate where uBO must be disabled. + +Example value: +{"trustedSiteDirectives": ["example.com","example.org"]} + +https://github.com/gorhill/uBlock/wiki/Deploying-uBlock-Origin:-configuration#toadd + The properties in the toOverwrite branch will wholly replace the corresponding local settings. Currently, the following properties are supported: + +filters +The filters property is an array of strings, which are meant to represent all the lines making the text to use as the content of the "My filters" pane. + +filterLists +The filterLists property is an array of strings, where each string is a token which identifies a list to enable by default. To enable a stock filter list, this is the token identifying the list as per content of assets.json. For an external list, i.e. not found in assets.json, the token is the URL of the filter list. + +trustedSiteDirectives +The trustedSiteDirectives property is an array of string, each of which must resolve into a valid trusted-site directive, used to dictate where uBO must be disabled. + +All the directives will be used to wholly replace the local trusted-site directives, including the built-in ones. + +Example value: +{"trustedSiteDirectives": ["example.com","example.org"], "filters": ["||example.com/log$xhr,domain=www.example.org"], "filterLists": ["ublock-filters"]} + +https://github.com/gorhill/uBlock/wiki/Deploying-uBlock-Origin:-configuration#tooverwrite + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/GroupPolicy/uBlock.admx b/tools/GroupPolicy/uBlock.admx new file mode 100644 index 0000000000000..f01c9210acae2 --- /dev/null +++ b/tools/GroupPolicy/uBlock.admx @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 6a542c5934da8618ff34e461f30c8520cab4b15f Mon Sep 17 00:00:00 2001 From: blue Date: Thu, 24 Mar 2022 22:22:33 +0000 Subject: [PATCH 2/6] Add Group Policy template for Google Chrome --- tools/GroupPolicy/uBlock.admx | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tools/GroupPolicy/uBlock.admx b/tools/GroupPolicy/uBlock.admx index f01c9210acae2..84d33d72599eb 100644 --- a/tools/GroupPolicy/uBlock.admx +++ b/tools/GroupPolicy/uBlock.admx @@ -15,6 +15,9 @@ + + + @@ -63,5 +66,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From db539e8f92b7d28f947d87428f4dc19a745ea5d2 Mon Sep 17 00:00:00 2001 From: blue Date: Thu, 24 Mar 2022 22:54:08 +0000 Subject: [PATCH 3/6] Add Firefox group policy template I've not been able to make the other, new settings work. --- tools/GroupPolicy/en-US/uBlock.adml | 1 + tools/GroupPolicy/uBlock.admx | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/tools/GroupPolicy/en-US/uBlock.adml b/tools/GroupPolicy/en-US/uBlock.adml index c8b672c3cad24..645323a2cd544 100644 --- a/tools/GroupPolicy/en-US/uBlock.adml +++ b/tools/GroupPolicy/en-US/uBlock.adml @@ -11,6 +11,7 @@ uBlock Origin Google Chrome Microsoft Edge + Mozilla Firefox Apply an exported configuration (adminSettings) Advanced settings to overwrite User settings to overwrite diff --git a/tools/GroupPolicy/uBlock.admx b/tools/GroupPolicy/uBlock.admx index 84d33d72599eb..5fc16f3a6812c 100644 --- a/tools/GroupPolicy/uBlock.admx +++ b/tools/GroupPolicy/uBlock.admx @@ -18,6 +18,9 @@ + + + @@ -112,5 +115,12 @@ + + + + + + + From a0dc55754291c0bb1f6ef22c9e7dd5719b0ff2ad Mon Sep 17 00:00:00 2001 From: blue Date: Sat, 26 Mar 2022 21:57:26 +0000 Subject: [PATCH 4/6] Add remaining Firefox policies Firefox preferences appear to not work because of https://github.com/uBlockOrigin/uBlock-issues/issues/2067 --- tools/GroupPolicy/uBlock.admx | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tools/GroupPolicy/uBlock.admx b/tools/GroupPolicy/uBlock.admx index 5fc16f3a6812c..7447e6f3aba52 100644 --- a/tools/GroupPolicy/uBlock.admx +++ b/tools/GroupPolicy/uBlock.admx @@ -122,5 +122,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From b83dcd1595a586e76e1e8a57ad25f0cfb457e3ff Mon Sep 17 00:00:00 2001 From: blue Date: Mon, 4 Apr 2022 19:16:53 +0100 Subject: [PATCH 5/6] Change Firefox sz policies to multi_sz https://bugzilla.mozilla.org/show_bug.cgi?id=1762253#c12 --- tools/GroupPolicy/en-US/uBlock.adml | 15 +++++++++++++++ tools/GroupPolicy/uBlock.admx | 20 ++++++++++---------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/tools/GroupPolicy/en-US/uBlock.adml b/tools/GroupPolicy/en-US/uBlock.adml index 645323a2cd544..2defb1c612fc9 100644 --- a/tools/GroupPolicy/en-US/uBlock.adml +++ b/tools/GroupPolicy/en-US/uBlock.adml @@ -122,6 +122,21 @@ https://github.com/gorhill/uBlock/wiki/Deploying-uBlock-Origin:-configuration#to + + + + + + + + + + + + + + + diff --git a/tools/GroupPolicy/uBlock.admx b/tools/GroupPolicy/uBlock.admx index 7447e6f3aba52..38f62d036ef03 100644 --- a/tools/GroupPolicy/uBlock.admx +++ b/tools/GroupPolicy/uBlock.admx @@ -122,43 +122,43 @@ - + - + - + - + - + - + - + - + - + - + From f6163cd9479e89cf651febaa8e7a35ac8002b48b Mon Sep 17 00:00:00 2001 From: blue Date: Mon, 4 Apr 2022 20:16:48 +0100 Subject: [PATCH 6/6] Accept truth-y values for DisableDashboard Make configuring via Windows registry easier. Specifically after 1 = true and 0 = false as booleans are usually stored as dwords, so could alternatively cast to boolean if typeof disableDashboard === 'number' --- src/js/storage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/storage.js b/src/js/storage.js index 4d29fc85d6454..8fd3eb0c5676b 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -208,7 +208,7 @@ import { hsDefault[name] = hsAdmin[name] = hsUser[name] = value; } } - µb.noDashboard = disableDashboard === true; + µb.noDashboard = disableDashboard == true; if ( Array.isArray(disabledPopupPanelParts) ) { const partNameToBit = new Map([ [ 'globalStats', 0b00010 ],