The power of uBO filters

I've heard people complain about the lack of granularity of uBlock Origin filtering compared to the no longer developed uMatrix add-on, and i've been one of those people. I still think Raymond's decision to abandon uM in favor of the allegedly easier to use uBO was a mistake and i'm certainty not alone. The pop-up interface of uMatrix always seemed more intuitive to me.

Some folks are adamant that uMatrix is superior to uBlock and is an absolute must-have, like breathing, however i'm not sure there's anything that one can do with uM that cannot be accomplished with uBO's filters, available in the 'My Filters' section of its settings. Other than adding a custom rule or two like *$font,third-party, which allows 1st party fonts while blocking 3rd party fonts, i've not been utilizing this filtering capability until very recently. These filters offer very granular control, right down to individual resources like a specific JavaScript file for a specific domain.

YouTube videos are a valuable resource of information but the website is a f'n joke from a technical point of view, as well as an assault on ones privacy. Sure, you can make use of the many alternative front-ends to YouTube (and Twitter, Instagram, Reddit, etc.) with a browser add-on like LibRedirect, but these alternatives come at a cost. They may not be able to handle the load, or they may be off-line, or they may be run by malicious actors, etc.. Nevertheless i think they are beneficial overall, especially if JavaScript does not have to be enabled to use them, but i digress.

YouTube serves up piles of shit (JavaScript) every time you load the domain and so i wanted to see how much of it could be toileted while still retaining much of the functionality of the platform like, you know, being able to watch videos and read comments and stuff. uBlock's logger makes it really easy to create these granular rules. With the logger open one can create either a URL (dynamic) or a static rule. While URL rules are more efficient, you can't use wildcards (*) in the file paths and for technically retarded sites like YouTube, which appear to use dynamically generated path names for some resources (.../player/c4225c42/player_ias.vflset/...), URL rules aren't going to work for all of the stuff i wanted to block.

I ended up trimming a fair amount of lard from YouTube using static filters while still retaining the appearance and functionality i wanted. Here's the filters i'm currently using (if you're on mobile you may need to adjust):

||fonts.googleapis.com^$stylesheet,domain=www.youtube.com
||jnn-pa.googleapis.com^$xhr
||www.youtube.com/*/jsbin/custom-elements-es5-adapter.vflset/$script
||www.youtube.com/*/jsbin/intersection-observer.min.vflset/intersection-observer.min.js$script
||www.youtube.com/*/jsbin/scheduler.vflset/$script
||www.youtube.com/*/jsbin/serviceworker-notifications.vflset/$script
||www.youtube.com/*/jsbin/spf.vflset/spf.js$script
||www.youtube.com/*/jsbin/web-animations-next-lite.min.vflset/$script
||www.youtube.com/*/jsbin/www-tampering.vflset/www-tampering.js$script
||www.youtube.com/*/player_ias.vflset/en_US/annotations_module.js$script
||www.youtube.com/*/player_ias.vflset/en_US/embed.js$script
||www.youtube.com/*/player_ias.vflset/en_US/endscreen.js$script
||www.youtube.com/*/player_ias.vflset/en_US/miniplayer.js$script
||www.youtube.com/*/player_ias.vflset/en_US/offline.js$script
||www.youtube.com/*/player_ias.vflset/en_US/remote.js$script
||www.youtube.com/api/stats/*$xhr
||www.youtube.com/generate_204$xhr
||www.youtube.com/s/search/audio/*$media,domain=www.youtube.com
||www.youtube.com/sw.js$script
||www.youtube.com/youtubei/v1/att/get?key=*$xhr
||www.youtube.com/youtubei/v1/share/*$xhr

5 thoughts on “The power of uBO filters”

  1. MyFilters is a key part of ublock. You can configure any website in any way you like, both in terms of optics and scripts. And btw ublock already has a built-in feature to disable remote fonts, so you do not even need a custom filter to block them.

      1. fine, but as the wiki mentions you can simply add it to myfilters, or else use another plugin to block remote fonts. there are also plugins to spoof your local font list, one of the strongest browser fingerprinting techniques.

        1. > as the wiki mentions you can simply add it to myfilters

          that’s what i’ve been doing and suggesting others do – there’s no need for another add-on

          as for font fingerprinting, my understanding is that RFP should take care of that, so again, no need for another add-on

Leave a Reply

Your email address will not be published. Required fields are marked *