Live data from Hacker News

Facebook adds 5 divs, 9 spans and 30 CSS classes to every post in the timeline

twitter.com

121–130 of 367 posts

Re: Facebook adds 5 divs, 9 spans and 30 CSS classes to every post in the timeline

#121
A few days ago [1], I found this filter for UBlock Origin to be working for me so far:

    facebook.com##[id^=hyperfeed_story_id_]:has([id*=feed_sub_title_]):has(span:has-text(/S.*p.*o.*n.*s.*o.*r.*e.*d/))
GitHub issue: https://github.com/uBlockOrigin/uAssets/issues/3367

[1]: https://twitter.com/mholt6/status/1092191140168622080

Re: Facebook adds 5 divs, 9 spans and 30 CSS classes to every post in the timeline

#122
post #83

Earlier quoted context omitted.

It sounds like a fun challenge. It's just ads. If we're talking about some ad for a coffee maker, whatever. Now their whole selling data to unscrupulous folks, taking money from parents via their kids, selling fake news that makes people hate other people (now that gets into the ad space...) .... That's where I'd want to nope out.

Thank you. I feel like ads have such a bad rap because of the state of the internet. Yet, what does everyone expect? Is it shocking that content providers want money for their product? And yes, I know, some sites and ads do terrible things. The actively hurt viewership. BUT, isn't that the same with everything ? Even my groceries are getting worse as companies seek ways to increase profits without pissing me off; the…

I choose to believe we could have a better world, where loading a local news site doesn’t look like a virus-ridden Windows 95 desktop, where just trying to talk with friends isn’t interrupted by.. (checks twitter) payday loan lobbyists. Where the smartest people of my generation are using every dark pattern in the world to take my attention away from what matters to me.

Re: Facebook adds 5 divs, 9 spans and 30 CSS classes to every post in the timeline

#123
post #97
post #69

Earlier quoted context omitted.

They could render the whole thing in canvas for example

So you'd block all canvas elements if ads are always a . If they turn all their posts into then it'd kill any accessibility features and the ability to copy-paste text and such so I doubt they'd go that far. Even then, a scraper could run OCR on the canvas image to get the text out of it.

I don't think these html pieces is very accessibility-tool friendly..

Re: Facebook adds 5 divs, 9 spans and 30 CSS classes to every post in the timeline

#124
post #85

Earlier quoted context omitted.

Not really. We have scraped many sites successfully that try this randomisation logic. There is always a pattern, which often can be determined via heuristics. It does make things trickier, but not impossible or especially difficult.

It feels like the point is just to raise the difficulty for script kiddies. After all, there’s always headless browsers and OCR

Yeah, it's a bit pointless really. If you're going to put data on the open web, you should be prepared for it to be copied.

Re: Facebook adds 5 divs, 9 spans and 30 CSS classes to every post in the timeline

#125

Anyone who has written a few scrappers knows how brutally ineffective this is. Yelp tried to pull the same thing and it took me about 3 minutes to rectify my "for fun" scraper. It's also really not that difficult to write a smart scraper that you say, "Look for these things in this post. However you find them, replicate it for the others". Which is ultimately what I made my Yelp scraper do. If there's a pattern, I wi…

Ad blockers are not as powerful as a scrapper, they basically a glorified CSS selector engine. This may be easy to bypass for a dedicated extension targeting Facebook, such as Social Fixer, but for a regular ad blocker it may be harder.

Re: Facebook adds 5 divs, 9 spans and 30 CSS classes to every post in the timeline

#126

Anyone who has written a few scrappers knows how brutally ineffective this is. Yelp tried to pull the same thing and it took me about 3 minutes to rectify my "for fun" scraper. It's also really not that difficult to write a smart scraper that you say, "Look for these things in this post. However you find them, replicate it for the others". Which is ultimately what I made my Yelp scraper do. If there's a pattern, I wi…

That works for a single iteration, but if there are multiple implementations that are randomly chosen when rendered it's a lot harder. Pretty easy to build a randomizing span algo that you can't hardcode.

I think you can just iterate over the text nodes and see if you stumble upon every letter you're looking for in the right order, it would work for any kind of randomly added text.

Re: Facebook adds 5 divs, 9 spans and 30 CSS classes to every post in the timeline

#127
post #35

I'm really thankful I haven't yet had a job where all I'm developing is new ways to force people to see ads. Imagine working on a 'feature' like this for weeks or months, and the end result is simply that people who don't want to see ads now have to see ads.

Ethics aside, this actually sounds kind of fun to me. It's the kind of clever puzzle solving many of us love about programming - it's basically a cat and mouse game.

The ad-blocking side of the puzzle looks just as fun without the ethical issues.

The discussion on the uBlockOrigin repo trying to detect this markdown mangling is super interesting: https://github.com/uBlockOrigin/uAssets/issues/3367#issuecom...

Re: Facebook adds 5 divs, 9 spans and 30 CSS classes to every post in the timeline

#128
post #108

Earlier quoted context omitted.

Yeah but what if your salary was north of $150/yr + stock and you were in your 20's? I'd be all over that back then. Hell, I'd be all over that now!

Are you like from CAR or Congo?

likely from implicit k.

Re: Facebook adds 5 divs, 9 spans and 30 CSS classes to every post in the timeline

#129
post #35

I'm really thankful I haven't yet had a job where all I'm developing is new ways to force people to see ads. Imagine working on a 'feature' like this for weeks or months, and the end result is simply that people who don't want to see ads now have to see ads.

Ethics aside, this actually sounds kind of fun to me. It's the kind of clever puzzle solving many of us love about programming - it's basically a cat and mouse game.

Ethics aside is a HUGE aside. You've just internally justified serial killing.

Re: Facebook adds 5 divs, 9 spans and 30 CSS classes to every post in the timeline

#130
post #96

I'm curious to know what the actual overhead is of doing this. Not that I'm defending the crap Facebook pumps into our computers, but is "5 divs, 9 spans, 30 CSS classes" actually a useful metric in measuring the performance of a page? If it was 4 divs how different would things be?

Well take the gzipped amount of data that adds up too then the average cache time it lives in the browser times the number of impressions and additions and you'll get a good metric for wasted bandwidth at least.
Post reply on HN