News for hackers. Stuff that matters.
Re:Facebook adds 5 divs, 9 spans and 30 CSS classes to every... by gothroach on Friday February 08, 2019 @12:08PM (#19116295)
One of my first thoughts when I saw this was about screen readers. If searching "Sponsored" in Chrome doesn't match the posts, I'd wager screen readers would just go ahead and try to pronounce all the extra 'S's.
Re:Facebook adds 5 divs, 9 spans and 30 CSS classes to every... by Someone1234 on Friday February 08, 2019 @12:13PM (#19116356)
It works fine.

Screen readers obey CSS, this uses CSS to hide all of the additional elements (display: none). Screen readers are also designed to work when text is broken up by other inline elements e.g.:

He<b>llo</b> world

In this case it reads out both the words Sponsored and Public.

> If searching "Sponsored" in Chrome doesn't match the posts

That also worked perfectly fine in Chrome, Firefox, and Edge. Did you scroll enough to render any Sponsored posts?

Re:Facebook adds 5 divs, 9 spans and 30 CSS classes to every... by CharlesColeman on Friday February 08, 2019 @12:29PM (#19116543)
So the technology to defeat this kind of obfuscation has already been developed and is reliable?
Re:Facebook adds 5 divs, 9 spans and 30 CSS classes to every... by Someone1234 on Friday February 08, 2019 @12:35PM (#19116620)
Well a web browser has to render it correctly, so yes? A screen reader is just another type of browser at this point.

These techniques work because some blockers only support a limited subset of what a full browser can do (namely block resource locations and specific HTML elements).

Re:Facebook adds 5 divs, 9 spans and 30 CSS classes to every... by barbecue_sauce on Friday February 08, 2019 @12:42PM (#19116712)
And rather insignificant to implement. All this protects against is low-effort document scraping. If they randomized it somehow, that would be a little harder to defeat.