Ads? On desktop? not in a million years with uBlock Origins. I forget how shitty internet is actually since several years now. Occasionally a new client doesn't have and I'm reminded of it, but it takes all of those 30 seconds to install it and no ads baby.
Actually I just started getting ads again, with uBlock Origin, both in YouTube and in newly-redesigned Facebook. I wrote a simple script that removes FB ads, but I need to "productivize" it and make sure it auto-loads...
Facebook's "sponsored" content is a disgusting mess of <span> elements with autogenerated IDs in order to bypass ad-blockers. How did you get around it?
It's a cat and mouse game. Every couple of months FB tries a new version of the HTML layout with slightly changed elements and every time someone writes a CSS selector that manages to find the appropriate tag for the sponsored story and hide it. Currently with the new FB redesign it's:
I find this so crazy! It says "Promoted" right there. I can use my browser's inspector to click on the element to select the div and then delete it.
Is there no simple way to accomplish the same in a browser extension without bringing in some crazy AI solution? Just read the webpage as it is rendered to an actual human, identify the x/y coordinates of the element, pass that to Firefox/Chrome/Safari's element selector, and delete. Voila!
I'm sure there's a very good reason why this exact solution just doesn't work, but I'd love to hear it explained, because it seems so simple to me. Then again I'm a backend guy, and I just don't even know frontend.
> Just read the webpage as it is rendered to an actual human
Humans read web pages using their vision. So what you’re proposing is to look at the final rendered image of text instead of the DOM tree. The only way to do that would be to perform OCR (https://en.wikipedia.org/wiki/Optical_character_recognition) on a screenshot of the whole web page. This would be possible, but I think nobody’s tried because it feels overly complicated, and many OCR libraries can’t understand text 100% reliably, not even computer-rendered text. Also remember that the OCR library would have to run in JavaScript. Would it run fast enough to block the ad before the user sees it? Would it annoy the user by spinning up their computer’s fan?
> identify the x/y coordinates of the element
This wouldn’t be too too hard to implement using `document.elementsFromPoint(x, y)`. This part isn’t the problem.
You could replace OCR with a CNN trained to predict bounding boxes of ads. You could generate the training data by looking at the visual diff between a page rendered with an ad blocker enabled, and the same page rendered with the ad blocker disabled.
I don't want a badly trained CNN accidentally removing relevant content from the page, though. The CSS selector solutions are deterministic, and you can't just throw ML at every damn thing you see.
Also, the problem with OCR/CNN solutions are that you have to render ahead (i.e. parts of the page that you haven't scrolled to yet) to remove ads without being disruptive to the website's content flow.
I'm not sure that facebook does it for the "promoted" text, but they have been known to mess with layout to make text difficult to detect. For example each character of a word might be in a separate <div> and be strangely offset so as to line up. The divs might not have the mutually common parent element that you would expect.
The browser has no context for what it is rendering. Should it ban every element containing "promoted"? Even posts by people?
The word "promoted" might not even appear as text, it might be simply a series of divs with one letter each (out of order, of course) and then visually defined with CSS.
The browser doesn't know it's rendering a word, it only knows it's rendering a series of divs with one letter on each, and it absolutely can't know what the visual representation of the divs spell.
What you are proposing is another crazy AI solution, OCR.
Which would mean to render the document, using pattern recognition delimit the area with the sponsored post, then pass those coordinates to the browser in order to select the currently visible element, then delete it.
Even then I could think of a thousand ways to beat this, because OCR can't see invisible things and you can do all sorts of fun stuff with invisible styling, and it'd be the same game of cat and mouse the ad blockers are currently running but at a higher level of abstraction.
I think the issue isn't finding the text "Promoted", but coming up with a way to figure out exactly which element containing that text to remove (because simply removing the text itself would not be a good solution). I imagine that Facebook could be doing something like generating a CSS class names on based by using a different seed or producing different element configurations that visually appear the same for each page load (or worse, for each ad on the page...)
Similar tactic on Twitter as well. I'm not even doing it for ad blocking necessarily, just to hide features I don't want like "who to follow" or all those nonstop COVID updates.
How can they get away with these deceptive obfuscatory practices without breaking web accessibility standards (e.g. screen readers parsing alt text and meta data for the visually impaired/blind) without opening themselves up to serious liability and class action lawsuits?
I didn't know about FacebookTrackingRemoval. I always used facebook_adblock[1] instead, which seems to do almost the same and has worked very well for me most of the time. I'm also seeing other comments here trying to figure out other solutions. It's making me wonder how much duplicated effort is being spent on the same problem.
I keep planning to write this script, but never get around to it. One of those messy autogenerated ID spans is "aria-labeledby" a span that clearly contains the text "sponsored". And it would be hard (legally) for Facebook to stop doing that.
Speaking of sponsored content. Both eBay and Amazon are unusable without uBO to remove sponsored listings that completely mess up my sorting and filtering.
Note that uBlock Origin is also "recommended by Firefox". In fact for some time now it's been the only supported extension on Firefox preview on Android.
I'll do my best, swinglock. I heard somewhere that UBlock Origin has acceptable ads, and based on that, the AdBlocker Ultimate had an appeal to me of removing them all.
I went on to investigate on it, and couldn't find much on UBlock Origin having acceptable ads. Some shady UBlock Origin-like websites claimed that, but UBlock Origin itself blocked them.
I'm wrong about UBlock Origin having acceptable ads, from what I gathered. Thank you for questioning my claims, swinglock.
Sometimes checkout on storefront sites will rely on scripts served from domains that adblockers block. When this happens, it's easy enough to turn the adblocker off for a few minutes (or, conversely, to decide "nope I'm not shopping here").
Weird formatting, things not working and you not remembering/understanding why, trying to keep settings in sync across browsers and platforms, and so on.
IOW I've found it easier to tolerate ads and slow sites "functioning as intended" than the much-less-frequent but far-more-maddening broken functionality that takes me "longer than it should" to troublehsoot.
I'm not sure I've used uBlock though, mostly ABP over the years.
See, if instead of this sarcastic quip you had bothered to come up with an insightful comment I might have had a chance to understand what you're trying to say.
Is it really all that unreasonable, as a consumer, to favor certain monetization schemes over others?
And I like it that way actually. If I can't see your site with my adblocker I am not going to ever land it again there. I also have NoScript and what I do is something like this:
Step 1 - open your site. Can't see it? I try to allow JS in NoScript
Step 2 - Still can't see your site due to shitty various techniques? Then I re-enable NoScript and add it to blacklist to never land on it ever.
Step 3 - You're not unique, your info is duplicated by several other dozens as well.