Skip to content

Instantly share code, notes, and snippets.

@timheuer
Forked from scarlac/purge_advertisers.md
Created December 29, 2018 04:22
Show Gist options
  • Save timheuer/5ea024069e2d94e8db387c8db0f71683 to your computer and use it in GitHub Desktop.
Save timheuer/5ea024069e2d94e8db387c8db0f71683 to your computer and use it in GitHub Desktop.
Facebook Hack: Purge list of "Advertisers you've interacted with"

For those of you who want to remove all in “Advertisers you’ve interacted with”:

  1. Go to https://www.facebook.com/ads/preferences/?entry_product=ad_settings_screen and open the section "Advertisers you've interacted with"
  2. Open Web Inspector
  3. Copy-paste this script to load all advertisers: javascript:smt=setInterval(() => {let x=document.querySelector('div[shade=medium]'); x ? x.click() : clearInterval(smt), console.log('done')}, 1000)
  4. It will output a number. Wait for it to say “done” in the console. This may take a long time. you'll notice the scrollbar changing while it's loading all advertisers.
  5. Copy-paste this and press enter: javascript:document.querySelectorAll('[data-tooltip-content="Remove"]').forEach(el => el.click())
  6. Wait for advertisers to turn grey, indicating they've been removed (this may take a while as well)

That's it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment