Cool script.
My hack is to live in a country where the local language is not my own, and not the one I have set in my Facebook settings.
As a result, Facebook rarely has advertisements that can target me, because my language has been filtered out by the advertisers.
When one does appear, it’s nearly always in the local language, so I’m kind of deaf to it and I’m not going to actively respond to anyway.
Luckily they haven’t figured that out yet, even though I’ve been an Facebook user for many years.
Much more entertaining: Get the list of advertisers. Find the ones who aren't allowed to share your data with Facebook, e.g. due to lack of consent or because they're bound by professional secrecy (e.g. banks or health related things). Report to your local DPA.
Reminds me of a court case [0] proactively challenging Facebook, due to a time the company gave someone a lifetime ban [1] for making this kind of consumer-tool.
[0] https://www.theregister.com/2024/05/02/meta_facebook_tool/
[1] https://slate.com/technology/2021/10/facebook-unfollow-every...
Reminder to use AdNauseum [1] that will not only hide the ads but also click it, messing with targeting and spending advertisers' money at the same time.
What is the motivation to prefer untargeted ads over targeted ones?
I'm worried that if you use this, Facebook will permaban you for something like "using modified or unauthorized clients to interact with Facebook services".
Intresting, for me the link 404's
This page isn't available
The link may be broken or the Page may have been removed. Check to see if the link that you're trying to open is correct.
Go to Accounts Centre
also Uncaught SyntaxError: await is only valid in async functions, async generators and modules
Separately, Firefox has a feature to isolate Facebook activity from other things you do on the web.
Weirdly, as much as I hate internet ads in general, I actually find the FB ones better. I've even bought some stuff from a few and been happy.
For me the correct URL seems to be: https://www.facebook.com/adpreferences/ad_settings/?section=... instead of what you have in the gist. (But the script errs on the awaits.)
I heard that sites like Facebook run A/B tests all the time, and the version you get served at a given time may not be the same others see. I also suppose the version you see may be slightly different on different territories somehow.
Also, these scripts break often as they depend on observable behaviors that are not contracts. It's Hyrum's law again.
Does this just impact ads shown on the site, or does it also cut down on data collection and targeting that occurs when you browse to third party sites who happen to include javascript from Facebook?
How's this technique compare to just staying logged out of Facebook? Or using it solely in a sandboxed browsing environment?
What's the legality of a script like this? Could this be construed as a violation of the CFAA if you were a motivated/evil enough lawyer?
I recall some surprising legal outcomes in recent years, for example jail for posting fake Yelp reviews. Anyone know of any case law for this sort of scripting?
The part I'm finding most interesting is that I clicked this link and have never heard of pretty much any of the targeted advertisers listed there.
OP here, I've updated the script for a bit more robust support when dealing with slow/delayed endpoint calls! Thanks for the feedback, HN!
Awesome script! I'm watching it run now :)
Question, could someone explain the exact impact this would have for Facebook & a person's experience with ads?
I kinda have a few guesses, but am curious if anyone can weigh in with more info, how this is crippling and overall what the effect should be. Thanks!
What browser is this intended for? The below error comes up on Brave on MacOS. Both most up to date version.
VM172:14 Uncaught TypeError: Cannot read properties of undefined (reading 'click') at <anonymous>:14:71 (anonymous) @ VM172:14
I get this on Safari on macOS: SyntaxError: Unexpected identifier 'wait'
and this on Chrome on macOS: TypeError: Cannot read properties of undefined (reading 'click') at <anonymous>:14:71
This doesn't appear to recognize any existing 'Don't allow' selections and fails when you've already disallowed some advertisers.
Godspeed good sir. When those shitheads from PerkinsCoie send you a legal threat make sure to share and shame them for it.
Unbelievable and incredible who hard Facebook makes this to do by hand. Completely unethical
What are the actual steps using the UI if one chooses to do it manually?
and he is banned from Facebook.
(for some that is a relief for others it is serious)
Anyone have something like this for Google?
Thank you OP, you're a mensch.
[dead]
[flagged]
[flagged]
This got a little stuck on a few of the `.click()` calls for me. Here's my version: