uBlockOrigin / uBOL-home

uBO Lite home (MV3)
GNU General Public License v3.0
1.2k stars 48 forks source link

noFiltering Admin Policy not working #174

Open pyther opened 3 months ago

pyther commented 3 months ago

I've declared the following configuration profile on macOS

com.google.Chrome.extensions.ddkjiahejlhfcafbddmgiahcphecmpfh
<?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>disableFirstRunPage</key>
    <true/>
    <key>noFiltering</key>
    <array>
        <string>grubhub.com</string>
        <string>google.com</string>
        <string>youtube.com</string>
    </array>
</dict>
</plist>

Chrome detects the settings, as seen via chrome://policy

image

The filter list is empty in the extension settings:

image

Adblocking is not disable for for grubhub, google.com, or youtube.com.

image

Chrome: 127.0.6533.100 uBlock Origin Lite 2024.8.5.925 macOS: 14.6.1

I'm not sure what other information would be helpful, but happy to provide anything needed.

gorhill commented 3 months ago

Did you try restarting the browser more than once?

pyther commented 3 months ago

Thanks, restarting twice did the trick. However, I noticed that sites that are removed from the noFiltering array are not removed from the No Filtering list. For example if I set noFiltering = ['google.com', 'facebook.com'] then change the array to noFiltering = ['youtube.com', 'grubhub.com'] all four domains are included in the plugin's No Filtering list. Is this expected behavior?

gorhill commented 3 months ago

Is this expected behavior?

Yes, the hostnames from noFiltering do not overwrite the existing ones.

cgerke commented 1 month ago

Is this expected behavior?

Yes, the hostnames from noFiltering do not overwrite the existing ones.

Planning to implement later?

gorhill commented 5 days ago

While working on https://github.com/gorhill/uBlock/commit/15dae359f7e9e75c49a86bad8a05ec3f7add3c35, I found out that there is a long delay at launch when reading policy settings through storage.managed.get(), on the order of 7-10 seconds on my side.

I revisited the policy-related code so that it can apply the policy settings in a deferred manner once they become available. Hopefully the issue here will benefit the change -- there should no longer a need to restart although the first time a policy is modified it might take seconds for it to become available to uBO. After this first time, uBO cache the policy in its more reliable storage so that it's available immediately at launch time.

gorhill commented 5 days ago

sites that are removed from the noFiltering array are not removed from the No Filtering list

Additionally, in the commit I added support for -*, which purpose is to remove all existing hostnames from the no-filtering list. Use this to start from a clean slate. Specific hostname can also be removed by prepending them with -, e.g. -example.com will remove example.com from the no-filtering list.