gorhill / uBlock

uBlock Origin - An efficient blocker for Chromium and Firefox. Fast and lean.
GNU General Public License v3.0
47.7k stars 3.17k forks source link

local file:// filter lists not loading in Chromium browsers #1971

Closed 0strodamus closed 8 years ago

0strodamus commented 8 years ago

Issue: I have a couple local filter lists that I use. If I add them to uBlock0's "3rd-party filters" Custom section using file:///home/username/.config/ublock0-filters/custom-filters.txt, they do not load. The filter name shows as file:///home/username/.config/ublock0-filters/custom-filters.txt and uBlock0 reports "0 used out of 0" and "out of date".

Resolution: I have found the following will allow local filter lists to load properly. Edit the uBlock0 manifest.json permissions starting at line 47, and add ,file:///*/* to the end of the list.

lewisje commented 8 years ago

That sounds similar to what an extension would need to do to request the permission to "Allow access to file URLs"; some extensions have that checkbox in the Extensions menu, but uBlock Origin does not.

gorhill commented 8 years ago

I need to add "optional_permissions": [ "file:///*" ] to the manifest.

Advantage of optional permission:

Easier upgrades: When you upgrade your extension, Chrome will not disable it for your users if the upgrade adds optional rather than required permissions.

Last time I changed permissions (added privacy to control pre-fetching, webrtc config, etc.), there was a lot of knee-jerking, i rather avoid this this time.

0strodamus commented 8 years ago

I did a quick test with "optional_permissions": [ "file:///*" ] in the manifest (replacing the permission I added in my first post) and noticed that my filters still weren't loading. However, after I opened the extensions tab and unchecked/rechecked "Allow access to file URLs", they loaded and are continuing to load properly after restarting the browser.