In praise of uBlock Origin's new 'element zapper' feature

June 23, 2017

The latest versions of uBlock Origin have added a new feature, the element zapper. To quote the documentation:

The purpose of the element zapper is to quickly deal with the removal of nuisance elements on a page without having to create one or more filters.

uBlock Origin has always allowed you to permanently block page elements, and a while back I started using it aggressively to deal with the annoyances of modern websites. This is fine and works nicely, but it takes work. I have to carefully pick out what I want to target, maybe edit the CSS selector uBlock Origin has found, preview what I'm actually going to be blocking, and then I have a new permanent rule cluttering up my filters (and probably slightly growing Firefox's memory usage). This work is worth it for things that I'm going to visit regularly, but some combination of the amount of work required and the fact that I'd be picking up a new permanent rule made me not do it for pages I was basically just visiting once. And usually things weren't all that annoying.

Enter Medium and their obnoxious floating sharing bar at the bottom of pages. These things can be blocked on Medium's website itself with a straightforward rule, but the problem is that tons of people use Medium with custom domains. For example, this article that I linked to in a recent entry. These days it seems like every fourth article I read is on some Medium-based site (I exaggerate, but), and each of them have the Medium sharing bar, and each of them needs a new site-specific blocking rule unless I want to globally block all <divs> with the class js-stickyFooter (until Medium changes the name).

(Globally blocking such a <div> is getting really tempting, though. Medium feels like a plague at this point.)

The element zapper feature deals with this with no fuss or muss. If I wind up reading something on yet another site that's using Medium and has their floating bar, I can zap it away in seconds The same is true of any number of floating annoyances. And if I made a mistake and my zapping isn't doing what I want, it's easy to fix; since these are one-shot rules, I can just reload the page to start over from scratch. This has already started encouraging me to do away with even more things than before, and just like when I started blocking elements, I feel much happier when I'm reading the resulting pages.

(Going all the way to using Firefox's Reader mode is usually too much of a blunt hammer for most sites, and often I don't care quite that much.)

PS: Now that I think about it, I probably should switch all of my per-site blocks for Medium's floating bar over to a single '##div.js-stickyFooter' block. It's unlikely to cause any collateral damage and I suspect it would actually be more memory and CPU efficient.

(And I should probably check over my personal block rules in general, although I don't have too many of them.)


Comments on this page:

By Corentin at 2017-07-15 10:06:17:

Hi, I found your blog while trying to hid the sticky footer on medium. ##div.js-stickyFooter works great but not medium.*.com##div.js-stickyFooter why ? Thanks !

By cks at 2017-07-17 11:49:47:

I'm afraid I don't know very much about rule-matching in uBlock Origin. I haven't tried to hand-write very many rules and so I haven't really dug into how the matches work, what all the options are, and how to achieve specific things.

By Corentin at 2017-07-21 09:07:18:

Thank you for the reply. No worries I'll just add several lines for Medium then.

By Charky at 2020-10-06 00:13:41:

Meh, the zapper should have the ability to make things permanent. It's largely a useless tool unless you're only going to visit one page on one website.

Written on 23 June 2017.
« Links: Git remote branches and Git's missing terminology (and more)
One tradeoff in email system design is who holds problematic email »

Page tools: View Source, View Normal, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Fri Jun 23 23:16:08 2017
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.