How to get rid of annoying parts of good websites

TL;DR;

I use ad blockers, and they’re amazing. I am shocked at how the internet looks like whenever I am using someone’s computer with no ad block.

My personal choice is ublock origin, for reasons I may or may not share at some later time. It blocks most of the ads, some annoying parts of some websites, but understandably, it’s conservative on what one may consider annoying. Luckily, one of the really cool thing about it is that you can just select some part of a website and it’s gone. This time, next time, and forever.

Unfortunately, the click and begone method is rather simplistic and sometimes it either blocks lots of similar blocks on the webpage, that shouldn’t be blocked, or it blocks just that very specific block, but there’s similar blocks that you also don’t want to see.

In my case, I am reading my Romanian news firstly from https://digi24.ro . They are mostly ok with presenting the news, but they promote the sports news sister website by inserting sports articles between real articles. I generally don’t mind this, if the title is obviously sports related (e.g. “Romanian football team lost again” or something of sorts), but sometimes they have titles that seem to be non-sport related, but then the article is just some silly speculation about something even barely related to sports. Sometimes they have titles like: “How Germany is dealing with the Coronavirus differently than Italy or Spain” and then you click and it’s an article about some German footballer who complains about how life’s tough in quarantine, but his spirits are still up because he also has footballer friend in Italy and it’s even tougher over there. I feel ya buddy, but I was trying to read some news. Most would probably advise to switch the news source. As I said, this one is one of the good ones, on Romanian news.

The articles that lead to the external sports website look the same, apart from a SPORT tag over the thumbnail (whoever you are in the digi team who probably opposed the whole thing but managed to get this tag there, thank you. You’re the unsung hero of the society!). If I try to create a ublock filter by clicking on the article, all the articles disappear.

After googling “ublock origin filter element based on child property” without an obvious result, I went to ublock’s filter documentation. After a few minutes of reading, I came up with this:

What I want to block is:

  • an article
  • which :has a figure
  • which :has an anchor link
  • which references a link
  • that starts^ with the sports website
article:has(figure:has(a[href^="https://www.digisport.ro"]))

My sanity is preserved for now!

Is this article unclear, or do you have questions on how to achieve similar things? Ask me in a comment, and I’ll have a look.

Leave a Reply

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