Skip to content

Instantly share code, notes, and snippets.

@NeilMasters
Created December 6, 2022 11:45
Show Gist options
  • Save NeilMasters/c2b4526ad671ec82383977246ed9c40f to your computer and use it in GitHub Desktop.
Save NeilMasters/c2b4526ad671ec82383977246ed9c40f to your computer and use it in GitHub Desktop.
Javascript to delete all of your facebook photos without having to do it manually.
/**
* Run this in your browser console and it will delete all of your facebook photos
* one after another.
*
* You will most likely need to fiddle with the css selectors but its basically:
* 1. Click edit of first photo
* 2. Click delete in dropdown menu
* 3. Click confirm in dialog
*/
setInterval(() => {
document.querySelector('.x9f619 .xfr5jun .x14ctfv').click();
setTimeout(() => {
document.querySelector('div.x1i10hfl:nth-child(3)').click();
setTimeout(() => {
document.querySelector('div.x4vbgl9:nth-child(1) > div:nth-child(2) > div:nth-child(1)').click();
}, 3000);
}, 3000);
}, 10000);
@kosarlukascz
Copy link

Thanks!

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