News for hackers. Stuff that matters.
Re:uBlock 1.48.0 Adds Readiness Status, Code Viewer, and Oth... by kgwxd on Tuesday March 21, 2023 @03:41PM (#35251445)
My solution is to leave the site :) and then add the domain to an add-on I made for myself that hides any links to it, on any page, any where.

I was hoping uBO would eventually get a dedicated feature like that, I don't think it's possible with filters. I tried pretty hard. I think knowing anyone could decide to completely erase a domain from their entire internet experience, down to the link level, would motivate sites not to do stupid things like this.

Re:uBlock 1.48.0 Adds Readiness Status, Code Viewer, and Oth... by gorhill on Tuesday March 21, 2023 @03:53PM (#35251615)
> I don't think it's possible with filters

We constantly create filters for detection issues[1]. Filter list maintainers have a lot of experience on how to work around such issues, with solutions that are often not obvious to people that are less familiar with filtering capabilities and syntax. The only way to know for sure whether it can be addressed is by reporting it.

* * *

[1] https://github.com/uBlockOrigin/uAssets/issues?q=is%3Aissue+...

Re:uBlock 1.48.0 Adds Readiness Status, Code Viewer, and Oth... by mtlmtlmtlmtl on Tuesday March 21, 2023 @04:45PM (#35252262)
I would totally use that add-on if you were interested in maintaining it as a publically available add-on.

Does it just strip out the <a> tag?

Re:uBlock 1.48.0 Adds Readiness Status, Code Viewer, and Oth... by kgwxd on Tuesday March 21, 2023 @05:41PM (#35252990)
It is in the official extension repository [1]. I had to put it there because of how difficult/impossible it is to run a local extensions. But it's definitely not designed for general use. I'll be glad to guide you if the tiny amount of help I've included isn't enough.

The source [2] is available too.

The actual idea of the extension is "Style stuff using regular expressions". So you specify a regex; what to search, attributes and/or text (text can cause a lot of undesired results so I don't use it much); and css styles to add to the elements containing matches. I only really use it to apply visibility: hidden to any element with an attribute matching one big regex that's basically just a bunch of domains regex |'d together. The example in the options UI is what I'm still using years later, I've just added more domains.

I originally started with just taking out tags but that idea was quickly shot down. Lots of links aren't <a> tags. Sometimes the domain being linked to is buried in some JS in a onX event attribute, or some data-* attr that the UI framework uses and a bunch of other oddities. So the code searches all attrs. It's not super efficient but I've never noticed it causing a slow down.

Another problem is, often, the original request doesn't even contain the links, they're loaded after. So it uses a MutationObserver and looks at the new elements for matches.

[1] https://addons.mozilla.org/en-US/firefox/addon/ssure/

[2] https://github.com/7w0/ssure/blob/master/content/content.js