DEV Community

Discussion on: I made a browser extension to hide reactions and notifications on Dev.to 💆

Collapse
 
moopet profile image
Ben Sinclair

I've been playing around with a couple of other ideas. I already use extensive adblock rules with ublock origin to cosmetically alter sites (like I get rid of menu items I never use, or related-content panels, that sort of thing). I was hoping to be able to come up with a subscribable filter list that covered all the major social media sites.

This approach falls down with sites like DEV because it's limited to just hiding whole elements, and DEV has text without surrounding tags. We could probably put in a PR to address that, but we couldn't do that for other sites, and if we had a PR to sort out the HTML we might as well make one to allow stats as a configurable preference.

How would you feel about expanding your extension to cover other sites, maybe through a list of rulesets?

Collapse
 
emma profile image
Emma Goto 🍙

I'm totally open to adding more websites! My only worry is for sites without static class names, is there a workaround for that?

Collapse
 
moopet profile image
Ben Sinclair

There's always drilling down through tags searching innerText for a pattern. I did that on Quora to get rid of some of their junk panels before. It's expensive on an infinite-loading page, so what I was doing was adding a class (or attribute, I forget) to everything after processing so it wouldn't have to search again when the DOM got updated. I don't have that code anymore but it's relatively straightforward, just kludgey.