TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How Facebook Avoids Ad Blockers

395 点作者 ganderzz超过 5 年前

40 条评论

gorgoiler超过 5 年前
Relatedly, uBlock Origin’s picker has really improved my quality of life on Facebook.<p>I love Facebook, it’s my only remaining connection to some people, and it’s revived many friendships I thought I’d lost.<p>However, as one gets on in life, <i>People You May Know</i> can be extremely emotionally impactful. It is a little part of the web UI that brings back the dead, ex partners I still miss, exes who have moved on, and toxic people I had tried to move on from.<p>It’s really put me through the wringer and being able to block that part of the UI forever is something I’m very glad Facebook, in the role I have gladly given it as being an overseer of my (mostly good) emotions, <i>does not</i> and <i>shouldn’t ever</i> stop me from doing. I hope they realize this.
评论 #21691481 未加载
评论 #21692229 未加载
评论 #21691620 未加载
评论 #21691350 未加载
评论 #21694419 未加载
评论 #21692393 未加载
jameshilliard超过 5 年前
It&#x27;s actually pretty simple to block with a recursive filtering algorithm like this:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;gorhill&#x2F;uBlock&#x2F;compare&#x2F;master...jameshilliard:has-visible-text" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gorhill&#x2F;uBlock&#x2F;compare&#x2F;master...jameshill...</a><p>or<p><a href="https:&#x2F;&#x2F;github.com&#x2F;tiratatp&#x2F;facebook_adblock&#x2F;blob&#x2F;master&#x2F;src&#x2F;main.js" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tiratatp&#x2F;facebook_adblock&#x2F;blob&#x2F;master&#x2F;src...</a><p>which was roughly based off of my rejected uBlock implementation.<p>Funny enough I haven&#x27;t even used facebook in years for the most part, I wrote one of those just to try and make them lose money as I believe I&#x27;m doing a public service by slowing their expansion&#x2F;world domination plans.
评论 #21690091 未加载
iamkroot超过 5 年前
I continue to be surprised at how few people have heard of fbpurity[1], a fantastic browser extension that blocks all Facebook ads and lets you filter out specific types of content (links, memories, etc.). It&#x27;s <i>dramatically</i> improved my Facebook experience; I now see exactly the type of content that I want to see (updates on friend&#x27;s lives) and nothing more.<p>[1] <a href="https:&#x2F;&#x2F;www.fbpurity.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.fbpurity.com&#x2F;</a>
评论 #21690002 未加载
评论 #21690924 未加载
评论 #21691275 未加载
gorpovitch超过 5 年前
I have a much better experience of Facebook since a few weeks by adding #stream_pagelet{ display: None } in Stylus for the homepage.<p>No news feed. No passive content consumption. Still got pages, events, groups, messages etc. Can still use the website in an active&#x2F;socializing way (looking for specific things, seeing relevant friends&#x27; notifications and invitations) but without being caught by the feed each time I come to check my notifications. Think I&#x27;ll do the same with pretty much every social network. Content feeds are the worst.
crakenzak超过 5 年前
Interesting article. I don&#x27;t blame Facebook for doing whatever they can to properly show ads tho, they provide a &quot;free&quot; service and in exchange serve ads. It&#x27;s not free to support a company their size and its expected they do everything they can to monetize the site properly.<p>What do you guys think?
评论 #21689976 未加载
评论 #21690037 未加载
评论 #21689956 未加载
评论 #21689835 未加载
评论 #21692968 未加载
评论 #21691796 未加载
评论 #21689820 未加载
评论 #21707750 未加载
评论 #21689818 未加载
fruffy超过 5 年前
I always wonder about the person that is responsible for designing these kind of schemes. What is their daily job like? What are they thinking about their work? It might even be fun because you are essentially competing against ad-blockers in cleverness.
评论 #21689918 未加载
评论 #21689964 未加载
wayneftw超过 5 年前
What happens when screen readers can&#x27;t identify things properly? Can Facebook be sued for not providing proper accessibility, given that their site is deemed to be essential by many?<p>If screen readers can identify something as an advertisement, then so should ad blockers be able to. If not... then aren&#x27;t we depriving the blind and the sight challenged from valuable advertising equality?
评论 #21692638 未加载
stiray超过 5 年前
How I am avoiding Facebook. Took their ASN, scraped ripe (<a href="https:&#x2F;&#x2F;stat.ripe.net&#x2F;widget&#x2F;routing-history#w.resource=AS32934&amp;w.starttime=2017-01-15T00%3A00%3A00&amp;w.endtime=2017-06-23T00%3A00%3A00&amp;show=Maxmized" rel="nofollow">https:&#x2F;&#x2F;stat.ripe.net&#x2F;widget&#x2F;routing-history#w.resource=AS32...</a>) and dynamically updating firewall rules to block them for my whole network. And I am so sorry google is having cloud &quot;hosting&quot; (AS15562) as I would love to do the same for them.
blauditore超过 5 年前
<p><pre><code> span[data-content=&quot;S&quot;] + span[data-content=&quot;p&quot;] + span[data-content=&quot;o&quot;] + span[data-content=&quot;n&quot;] + span[data-content=&quot;s&quot;] + span[data-content=&quot;o&quot;] + span[data-content=&quot;r&quot;] + span[data-content=&quot;e&quot;] + span[data-content=&quot;d&quot;] { display: none; } </code></pre> This only hides the &quot;d&quot;, right? You generally can&#x27;t hide a higher-level element based on drill-down selectors, so pure CSS wouldn&#x27;t be enough. But of course, finding the appropriate parent by scripting would be trivial from here.<p>Apart of that, why can&#x27;t one just accumulate all visible text by filtering out all `display: none` elements? Of course, this could be attacked again by e.g. shrinking the &quot;noise&quot; characters to width 0.
评论 #21691753 未加载
charliesome超过 5 年前
How does this impact assistive technologies? Are Facebook users using screen readers left unaware of what&#x27;s an ad and what&#x27;s not?
评论 #21690519 未加载
评论 #21692058 未加载
babuskov超过 5 年前
I actually don&#x27;t mind Facebook ads. If I&#x27;m on Facebook already, there&#x27;s no additional javascript loading and hogging my browser with dozens of megabytes of tracking scripts. From performance point of view, browsing FB is a better experience than your average web site these days.
评论 #21691173 未加载
评论 #21690707 未加载
评论 #21690641 未加载
jedberg超过 5 年前
What really makes me sad is that some presumably quite talented engineer spent time thinking this up and coding it.
评论 #21691190 未加载
turc1656超过 5 年前
I don&#x27;t use Facebook, but I imagine the easiest way of blocking the ads is like most other websites - to block the connection to the ad-server(s), no? That&#x27;s how uMatrix operates and, in my opinion, that works exceptionally well. It blocks known domains that are ad-servers and that alone blocks damn near everything because of the way ads are served on nearly every single website.<p>In fact it works so well that pretty much the only time I&#x27;ve noticed ads has been when I look at uMatrix and I see there aren&#x27;t direct user connections to the ad servers. For those pages, it looks like the site itself is acting as a middle man and pulling the ads and inserting into the HTML via scripting. But that&#x27;s a lot more work for developers to do, as well as more bandwidth and overhead. I don&#x27;t know if those sites are able to tailor ads to individual users when they do this - they would need some sort of identification to pass to the ad server so the ads on those sites <i>might</i> be generic, not sure.<p>But that&#x27;s my observation, FWIW.
psykus超过 5 年前
Don&#x27;t they host their own ads? Something I wish more websites would do instead of letting ad networks stomp all over the page with whatever Javascript&#x2F;Flash&#x2F;viruses they want.
评论 #21690345 未加载
jesperlang超过 5 年前
The main news feed is such a toxic space anyway so I just blocked it in general with this uBlock filter:<p>www.facebook.com##div[id^=&quot;feed_stream_&quot;] &gt; div
Cougher超过 5 年前
Commenting about some of the comments . . .<p>Yes, ads are what keeps facebook and other websites running, but there&#x27;s a blurred line that crosses from offering content for users to offering users as product. To attract readers, they provide content that has value. Then they do everything in their power to distract you from what you came for. When the distraction is too overpowering and irritating many people will complain and leave. It doesn&#x27;t necessarily mean that we don&#x27;t understand the money model; it&#x27;s that we obviously are not going on the internet to see ads that take primacy over our online experience.<p>The line may be blurred, but facebook users are not facebook&#x27;s customers; they are the product. Facebook offers this product to the businesses that pay for access. Inasmuch as facebook focuses on an engaging user experience, it&#x27;s only to ensure that they maintain their product so businesses keep buying it. It&#x27;s interesting how this product maintenance has evolved: like news or reality shows or contest shows, the aim is to introduce tension, and in the case of news topics, anger, which oddly keeps people coming back for more. The aim of providing an engaging user experience has morphed into providing an addictive user experience. And like most addictions, what started out as an enjoyable pleasure transforms into something that controls and destroys us to varying degrees.
评论 #21692225 未加载
veselin超过 5 年前
Yes. This is horrible behavior from Facebook. I had a similar problem finding a working extension that blocks fbclk id. Well, I found one, but I am not sure I would want to share it, because the facebook engineering team may go after it as well.<p>This also renders nil the argument about &quot;don&#x27;t use the product if you don&#x27;t like their (ad) practices&quot;. Tracking across websites without consent is illegal in most of Europe, yet they do it extensively.
评论 #21690921 未加载
shmerl超过 5 年前
Sounds like if CSS could allow matching by patterns, it could still block it out? I.e. something regex &#x2F; wildcard like? Though performance probably would suffer.<p>More advanced ad blocker can probably use some AI, that could be trained with user&#x27;s hints about what is an ad. Or it can use some OCR for that purpose. If you can recognize that it&#x27;s labeled &quot;Sponsored&quot;, so can ad blocker potentially.
评论 #21689849 未加载
goatinaboat超过 5 年前
To me this is very simple, if someone installs an ad or tracking blocker then they are explicitly withdrawing consent, there is absolutely no ambiguity about it. Doing it anyway or de-anonymising them or anything else is impossible to do without equally explicitly knowing that you are violating consent. And every Facebook employee must know it.
评论 #21691831 未加载
aaron695超过 5 年前
I assume this problem is the same reason why accessibility programs suck?<p>Given the billions that could be saved by making programs that interpret web sites rather than programmers learning and writing for accessibility I&#x27;d hope it&#x27;s because it&#x27;s impossibly hard, not because no one will create it.<p>I&#x27;d also help with testing......
joestr超过 5 年前
Question for anyone in the know: Is this allowed, from an accessibility point of view? I&#x27;m just wondering how someone with a screen reader would know it&#x27;s an ad? (Or are screenreaders more advanced than I think, and would actually be able to read out &#x27;sponsored&#x27;)?
评论 #21691517 未加载
hirako2000超过 5 年前
I&#x27;ve put down the steps to kill all the junk out. “Customize your Facebook Experience” by Hirako2000 <a href="https:&#x2F;&#x2F;link.medium.com&#x2F;6q6LZgGV61" rel="nofollow">https:&#x2F;&#x2F;link.medium.com&#x2F;6q6LZgGV61</a>
elierotenberg超过 5 年前
It reminds me of a lightning talk I gave at ReactConf some time ago :)<p>Basically forward-shuffling the component tree to produce HTML that will be really hard to match using CSS Selectors usually found in adblockers and other DOM-targeting scripts.<p>Code: <a href="https:&#x2F;&#x2F;github.com&#x2F;elierotenberg&#x2F;react-armor" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;elierotenberg&#x2F;react-armor</a><p>Video: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=n63XXHY4A7I" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=n63XXHY4A7I</a>
jakub_g超过 5 年前
For more crazy adblocker avoidance solutions found in the wild, check this presentation from JSConfEU 2019 from an ABP employee:<p><a href="https:&#x2F;&#x2F;2019.jsconf.eu&#x2F;shwetank-dixit&#x2F;block-unblock-block-how-ad-blockers-are-being-circumvented-and-how-they-are-fighting-back.html" rel="nofollow">https:&#x2F;&#x2F;2019.jsconf.eu&#x2F;shwetank-dixit&#x2F;block-unblock-block-ho...</a><p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Vk9bPDaZELQ" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Vk9bPDaZELQ</a>
maury91超过 5 年前
I wrote a similar article some time ago with a look at how to detect them and remove them from the DOM. It was mostly for didactic reasons.<p><a href="https:&#x2F;&#x2F;medium.com&#x2F;hackernoon&#x2F;how-i-get-rid-of-the-new-sponsored-facebook-posts-138d013f4bbe" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;hackernoon&#x2F;how-i-get-rid-of-the-new-spons...</a><p>but my approach was to use Javascript instead of CSS
kalado超过 5 年前
Not only the ads. I once recreate the feed for a university project. Just take a look at the sources. Every element is completely obscured, every class and id is just long random strings.
rustybolt超过 5 年前
Nice breakdown. If I open facebook I can see the &#x27;sponsored&#x27; as plain text right there in the developer tools... It might make a difference that I&#x27;m using chrome in Dutch?
tiku超过 5 年前
Why can&#x27;t AI solve this problem for us. It should be fairly simple now to make a bot &quot;read&quot; words just like us instead of using CSS&#x2F;HTML&#x2F;JS to block ads.
craigds超过 5 年前
I wrote a greasemonkey script that runs every 250ms and blocks these. It might be hard with CSS but it&#x27;s (almost) trivial with a spot of JS
jk27277超过 5 年前
<a href="https:&#x2F;&#x2F;socialfixer.com" rel="nofollow">https:&#x2F;&#x2F;socialfixer.com</a><p>But is not as good anymore as it used to be
a_imho超过 5 年前
How the narrative that content blockers are a non threat has fallen.
yccheok超过 5 年前
Don&#x27;t let Facebook get away with this!
vector_spaces超过 5 年前
I have seen a similar technique used to build paywalls for research papers that display obfuscated &quot;previews&quot; of the article you clicked on beneath the &quot;pay for access&quot; banner
asow92超过 5 年前
just stop using facebook. no more ads.
mesarvagya超过 5 年前
Or you can use Pi-hole and remove any and all ads :)
评论 #21690659 未加载
1propionyl超过 5 年前
I&#x27;m surprised I haven&#x27;t seen a single comment say what ought to be the obvious: the easiest way to never see Facebook ads is to just not use Facebook.<p>I should hope I&#x27;m preaching to the choir, I&#x27;m sure, but... quitting really isn&#x27;t as hard as you tell yourself it is.<p>It&#x27;s not as essential as you think it is.
评论 #21690644 未加载
评论 #21691017 未加载
评论 #21690483 未加载
评论 #21691428 未加载
评论 #21690683 未加载
评论 #21691152 未加载
评论 #21691223 未加载
评论 #21690832 未加载
评论 #21691339 未加载
评论 #21692507 未加载
评论 #21695256 未加载
评论 #21691819 未加载
评论 #21691386 未加载
评论 #21691789 未加载
评论 #21691942 未加载
评论 #21692912 未加载
评论 #21690725 未加载
评论 #21691322 未加载
评论 #21691728 未加载
评论 #21691276 未加载
评论 #21690909 未加载
评论 #21691120 未加载
cowbird超过 5 年前
A year ago, I was on Facebook constantly. At one point, I realized that I could do better things with the time wasted there so I installed News Feed Eradicator (I learned about it in a podcast. I think a Peter Attia podcast, but I could be wrong). Anyway, now Facebook is alien to me. I still have it on my laptop, and if I need to search something of for someone,I can use Facebook. But I don&#x27;t have access to scrolling. I don&#x27;t have a wall anymore. lol. I don&#x27;t have the app on my phone though. I feel super.
sub7超过 5 年前
Someone should write this: an blocker that uploads a screenshot of the page, use OCR to find &#x27;Sponsored&#x27; and send back coordinates of the box that can then be painted over client side.<p>Obviously OCR is one of many strategies and as long you kept the code for these adblock strategies open source, it would work on all visual ads.<p>Train an AI with a billion screenshots of pages with ads marked out. It should be able to handle 90+% of ads easy.
zupreme超过 5 年前
Current tech available is already well beyond this, but simply needs to be properly applied.<p>Facebook Ads look like ads, by design. Shift gears to IMAGE RECOGNITION and success will follow.
paggle超过 5 年前
I cannot understand the people who believe it’s their absolute right to use an ad blocker (a position I agree with) but then don’t believe it’s the site’s absolute right to decide whether or not they will serve you content.
评论 #21690010 未加载