-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
question/suggestion: centralized custom filter/whitelist settings? #832
Comments
If I understand correctly what you want to accomplish, it's already supported in Firefox. However for Chromium-based browsers, I have been waiting for such request so that I can test the code I need to hook to I will let you know when I have something. |
Yes, exactly. Thank you for considering this! And yes, obviously, for use on Chromebooks this is Chromium-based (although I have no idea where the config file is stores on ChromeOS.) |
Implemented in 1.3.2b2. I will need you to validate whether this works, I do not have the environment to test this. |
I tested, but can't tell if my test config file isn't right (although it loads without error), or if this isn't working. For a test config file, I went to uBlock options (after adding specific things to the whitelist) and did 'backup to file'. I then loaded that file into the Chrome App Management tool, and forced the app to auto-install to a specific testing user. The user gets the app just fine, but only with the default config. The config I installed isn't being pushed across. Thinking after reading more that the config will only look for "adminSettings", I made a new config file like this: { That's it. I loaded that, no errors, but the config isn't being pushed out. Confirmed via chrome://policy that no policies are being loaded for uBlock Origin. (Ideally I'd like to be able to push a custom netWhitelist addition, but I'll be satisfied with being able to add to externalLists.) |
That's not a valid backup file, it contains nothing of value for uBO. Try:
What I did is:
Now, assign the resulting string (it must pass as a valid JSON string) to the entry |
I am guessing wildly as to how to set up the config file, based on the example given at http://www.chromium.org/administrators/configuring-policy-for-extensions. I've tried
(after running that through jsonlint to make sure it's valid), and.... no value is being assigned to adminSettings. |
The value of
This must be used as a literal string, i.e. the type of (there was a typo in my above example, I just fixed it). |
So:
? Tried that, still says no policy set. |
Ok, I followed the doc for Linux at the link you posted above, and it worked here. I created a JSON policy file name
Then I restarted Chrome, and the "Color blind friendly" setting was checked. For other OS, I can't tell. Notice how the value of This is what Chrome's |
Note that as mentioned, I rely on feedback to fine-tune this, and I think I will also offer the ability to encode the value as plain JSON -- not force a stringified JSON, to enable not having to escape double-quotes. |
Sounds like. I tried this:
and still no dice. |
Your JSON does not pass validation. Try:
|
Duh. :) I tried that and..... almost success! The policy is set, according to chrome://policy. The policy value, literally is
However, in uBlock's options, that setting is NOT set to true. It's still false. |
I still can't get userSettings to be set, but I did successfully get a netWhitelist to stay. I loaded this:
(domain names edited to protect the guilty). This did properly load. |
First and foremost - gorhill - thank you for your efforts with this, your contributions are amazing and its a huge help. I'm hoping that I can contribute to this somehow by creating a policy template for Windows users, that will make it easier to manage these settings from Windows. benwa, |
It could possibly be white space or different quote characters. Before I deployed via Group Policy Preferences, I wrote out the preferences here and then used Minify to set it all to one line. |
It is necessary .admx and .adml files for use in the GPO on Windows, without setting through the policy files in the Chrome settings do not work and do not apply :( |
This is great! I was able to deploy a custom whitelist to some Chromebooks and Chrome browsers. The only thing is if I change the policy and the browser receives the new policy, uBlock doesn't actually use the new settings until the next time the browser starts up or you can force it by reloading the extension (as benwa said). Is there any way to have it periodically check and apply the currently loaded policy? Or is it possible I was just being too impatient? |
I am a GAFE admin with managed Chromebooks that I would like to deploy uBlock Origin to. I have pushed the extension out to users, and created the custom JSON file, but I am missing how do I distribute the JSON file out to all the users? |
I have a Chrome dev version for testing, and I use a policy on it to validate that policy settings work: I actually forgot how I created this entry... You are probably better placed than me to figure this. But as you can see, the value is |
If you're using Google Apps, you need to deploy the extension to your users by navigating to Device management > Chrome > Chrome App Management Once added, click the app and expand User settings. Pick the OU, Force Install and click UPLOAD CONFIGURATION FILE and then select the text file containing the json configuration. The json is not necessarily a full config dumped from uBlock. Ours is just a simple whitelist. This is the full content of our configuration file. It's a bit ugly having to nest json inside json and it might get messy with a large whitelist. { "adminSettings": { "Value": "{ "netWhitelist": "about-scheme\nbehind-the-scene\nchrome-extension-scheme\nchrome-scheme\nloopconversation.about-scheme\nopera-scheme\ndomain.com\nanotherdomain.org\ndomain.ca.us" }" } } |
Ahh, the missing link. I was installing the extension from the user
|
@killebrewj I am almost there. I was able to create a JSON, file upload it and have it show up in chrome://policies. I have restarted the Chromebook and reloaded the extension, but I don't see any of the sites I have added in the whitelist of uBlock Origin. |
Did you check your JSON string with a JSON validator[1] to be sure it's properly formed? [1] http://jsonlint.com/, http://codebeautify.org/jsonvalidate, etc. |
The JSON file appears to be working: And we did get colorblind setting to { "adminSettings": { "Value": "{ "netWhitelist": Bjorn Behrendt M.Ed ~ Never Stop Learning
On Tue, May 31, 2016 at 9:07 AM, Raymond Hill [email protected]
|
Probably the |
Just stumbled upon this thread while implementing policy settings to start pushing out uBlock to replace ABP across all our Chromebooks. With a little fiddling, was able to push multiple settings and the netWhitelist with multiple domains. One question, though, is if there's a way to push out whitelist domains that doesn't replace the user's whitelist settings? When I push out a couple domains via the netWhitelist value, it replaces the entire list rather than appending/updating existing ones. For anybody else's benefit, here's the JSON I'm using in testing that has a couple user settings as well as a couple example whitelist domains:
|
Please use the encoder tool to avoid mistakes. Your string is not correct, the
Try:
Which decoded is:
|
Ha! I did not see that tool! Thank you, @gorhill! Much appreciated. Unsurprisingly, it works now :D |
Sorry for maybe asking in the wrong place, but is there some guide anywhere how to export the settings and then push them to users? I don't want to whitelist anything (right now), but I do want to enable Dan Pollock's host file for everyone. I found where to export settings from one browser, but do I really need to push all that? Isn't it enough to push the diff from the default settings? |
On top of the existing settings or to replace the existing settings? |
Since this will be for people who have never before used it, the primary
objective would be replace.
If it has to be done again, some time in the future, I think I still feel
replace would be the proper approach. Don't you?
|
Entries in |
Personally, I prefer the approach of if it's not defined in the policy, use defaults or user settings. That follows in line with Chrome's (and Group Policy-like systems) methods. |
There is this: https://github.com/gorhill/uBlock/wiki/Deploying-uBlock-Origin. With 1.11.0, selecting filter lists will be much more simple -- it will be the |
Can someone help me please. I'm losing my mind trying to get this working on Windows. I am not using Group Policy and I do not currently have the Chrome administrative template installed. I'm unclear if this is required but I wouldn't think so. This is for a local machine that will be accessed by many users. I have manually set the necessary registry entries like so. The extension installs automatically just fine but for my life I can't get the policy to take effect. I tried a much more detailed set of settings at first but after I couldn't get those to work I decided to just try one non-default setting which is what you see above. The string I used for adminSettings is: I ran the original code through a JSON validator and then ran it through @gorhill's encoder tool to get it to a single line, so I'm pretty sure the formatting of the string is not the problem. What am I missing? |
The default value for |
Wow, I can't believe I did that. I changed the value to true and still nothing. Either way, shouldn't the fact that the extension is installed and the properly formatted registry value exists cause the policy to show up as enabled under chrome://policy? |
Yes, it should show in |
Actually, the user who succeeded in making it work is using |
I think he's using HKEY_LOCAL_MACHINE because he wants the policy to run
for all local users.
|
Thank you so much for implementing this for us poor overworked security conscious admins. It worked flawlessly on the first try after following the writeup @ https://github.com/gorhill/uBlock/wiki/Deploying-uBlock-Origin |
Hi @benwa, I know, it's an old post but do you know how can I do the same for Privacy Badger, what you suggested for UBlock Origin via GPO? |
Thanks a heap for looking in to it. In fact, we have deployed both Privacy Badger and UBlock Origin. They both are blocking AddThis share buttons on our websites; therefore, I wanted to add our required domains to their whitelist domains |
@gorhill: How would you do the same adminsettings for MACos with plist? Is there a converter I can use? |
First: this thread has been a HUGE help! I still have an issue related to this: If I "pause" uBlock Origin on a page and then reset chrome, the policy settings will overwrite whatever pages I've paused. If I don't have the adminSettings registry item, it won't overwrite the pages I've paused. Is this expected behavior and is there a work around that allows me to push the whitelist to all computers without overwriting a user's personal pause/white list? |
I did the same as @KTac second screen on W10 Home Edition and didn't work. I don't know why nobody is sharing a reg file to make things easier, so i'm sharing the one that i'm doing:
|
hey kingio it is very easy. use ublock backup to file function with the settings you want to have. |
@miruser i already did that without success (ublock policy space appears in |
hey kingio.. Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\3rdparty\extensions\cjpalhdlnbpafiamejdnhcphjbkeiagm\policy] |
hey gorhill, Thanks for all the hard work and info here. I was wondering if you've had a chance to work on merging the user's setting and the adminSettings? We are looking to push an initial set of sites for whitelisting and then let the users add to it as they please going forward. Can you think of a good what to do that? I was thinking perhaps if there was a local configuration file that we can modify and push out during the deployment that contains a set of predefined whitelists and can be added to the users, that would work. Let me know your thoughts. Thanks again |
I've read all these comments and am still having issues uploading a simple whitelist to GAFE for my users. This is the string I'm trying to use:
Am I missing something here? |
On Chromium Edge, the registry location is: Now a question: is there a way to have the settings stored in a file like in Firefox? So I could point to that file (stored in the network) and not have to edit settings in two places in case I want to change a setting. |
Background: I have a number of Chromebooks under managed enrollment in a Google Apps domain. I'd like to push uBlock Origin out to all of them (which we can easily do), but I'd also like to be able to create our own custom filter (actually mostly whitelists) and also push that out to all of the Chromebooks. If the app/extension is set up to support a config file, we can easily do that through Google Apps as well.
Can this be done, and if not currently, can it be put on the feature request list?
(Edited to add: more info on config files here: http://www.chromium.org/administrators/configuring-policy-for-extensions)
The text was updated successfully, but these errors were encountered: