uBlock Origin notes

uBlock Origin is a free (GPLv3), fast, and customizable content blocker for your web browser.

“Content blocker?”, you ask. “Don’t you mean ‘ad blocker’?” No! Ads aren’t the only kind of web spam it blocks, and I should say I think a “spam blocker” is a good metaphor here. Just like your email spam filter prevents unsolicited advertisements, it also importantly blocks malware, phishing, and anything else you think is spam.

uBlock Origin, similarly, can block tracking, fingerprinting, phishing, malware, and cryptominers. And these are just the obviously bad things. You can also creatively use it to block distractions, attention-grabbers, bandwidth-intensive resources on mobile, or even comments by specific users you dislike. Blockers not only increase your security on the web1, they increase your agency as a human. Use it to block anything that “steals” your bandwidth or “infringes on your attentional or emotional property”.

My Filters

I’ve got some uBlock filters at /ubofilters. You can import it by adding the URL “” to your rules. You probably shouldn’t, though. In particular, I block YouTube’s homepage because it’s a distraction.

I mostly use cosmetic filters. My rules do things like highlighting MDN and hiding blogspam in search engines. I also dislike sticky headers in mobile, so I force some of those to be static.

Unsticking sticky elements

I dislike sticky elements robbing me of screen real estate, especially on mobile. I tend to use the following rule a lot:

##*:matches-css(position: sticky):style(position: static !important)

Blocking distracting websites

Sometimes you want to stop yourself from constantly refreshing a distracting website. Like, sites with infinite feeds that’ll make you doomscroll for hours. You can block entire pages like so:



Scriptlets are small pieces of Javascript that are used in rules to facilitate some aspect of blocking. For example, they might prevent certain events from triggering popovers or they could set/remove cookies that a website checks. You can see some documentation for various scriplets on the Resources Library page on the uBlock Wiki.

Blocking geolocation prompts

One example use of scriptlets is to block geolocation prompts in private windows. Normally in Firefox, you can deny a location prompt (e.g. “Allow to use your location?” and check the “Remember decision for this site” box). However, this preference isn’t remembered in private windows, which actually kind of makes sense since private windows aren’t supposed to remember anything. But this also means you’ll annoyingly have to deny geolocation requests each time. This tends to happen with commerce sites like Best Buy or Ace Hardware.

Using the abort-on-property-read.js scriptlet, we can defuse attempts to access geolocation like so:, navigator.geolocation)

Now code that tries to read your geolocation will throw an error.

Custom Scriptlets

You can make your own custom scriptlets, but you need to make a URL for them. Then you can set your “userResourceLocation to point to your URL(s).

This used to be a hidden setting that you could only modify by editing a JSON file. Like, there’s a "hiddenSettings" section where you’d need to add a “userResourceLocation” key and value. It looks like as of 2023-11-03 that it’s not a secret anymore.

I’ve got some old scriptlets located at /scriptlets.js, which I mostly just used to remove sticky headers.


Besides turning on the advanced user setting, I also like to set:


  1. ^ Even the FBI wants you to have an ad blocker.


  1. Cyber Criminals Impersonating Brands Using Search Engine Advertisement Services to Defraud Users. Federal Bureau of Investigation. . Retrieved