Yes, definitely use mutation observers. Far faster to react and doesn't require polling, they're better in essentially every way when things aren't changing many times per second.
This is just the straightforward idea of waiting for some element to appear on the website. But once the element is found, this thing stops. It won't stop for YouTube if you are on Facebook though but it's just a first implementation and it could actually be very easy to recognize the site. Thanks for the helpful suggestion!
I wrote an extension that did something similar for Twitter, back when Twitter had "So-and-so liked this" tweet, which was inevitably something awful. It's archived now, because it's no longer relevant. But you might find something useful in the code.
I tried polling, but it was against the Chrome extension guidelines at the time, so I used a "mutationObserver" on page load and then a "scrollListener". I don't remember if I ever tried an "intersectionObserver" but that might be worth looking at.
The advantage that speaks to me, is that I control everything. I'm not sharing my data with the developer of the extension so it's one person less that I have to trust. I can also very easily adjust it to my needs, but I can program, so it's not valid case for everyone.
The current version just grabs the whole feed and removes it from the website. If you can program, it won't be hard for you to extend it so you can remove only the content you want.
The main problem that I have with extensions is:
"It can:
Read and change all your data on all websites"
Having my own, local extension I don't have to actually think whether I added some sensitive stuff to be exempt from permissions or not.
The whole point is to actually have installed locally so you don't share any data with the developer of the extension. The problem with extensions is that in many cases the access that you give them is way too broad. If you install it by yourself, you control everything. The only thing that I thought about is maybe some kind of configurator that would allow you to pick some already existing rules that the users would share through github.
Thanks for pointing this out. The whole discussion around "the developer doesn't see my data" confused me, as the question of whether the code is malicious is orthogonal to installation method.
Given that uBlock Origin can do this, I'd recommend that route. uBlock Origin is probably the most trustworthy extension I've ever run across, and Gorhill has proven that he is trustworthy over many years.