Last active
October 22, 2021 11:19
-
-
Save pocesar/3af3d73479c8f67a234f30e40ffcd41e to your computer and use it in GitHub Desktop.
Facebook Javascript delete all photos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async function walk() { | |
const waiter = (time) => (new Promise((resolve, reject) => { | |
setTimeout(resolve, time) | |
})) | |
const photo = document.querySelector('._3-8h._50zy._50-0._50z_._5upp._42ft') | |
const okBtn = '.uiOverlayFooter ._4jy0._4jy3._4jy1._51sy.selected._42ft' | |
if (photo) { | |
photo.click() | |
let l = 1 | |
while (true) { | |
await waiter(1000 * l++) | |
let k = document.querySelector(okBtn) | |
if (k) { | |
k.click() | |
while (document.querySelector(okBtn)) { | |
await waiter(100) | |
} | |
break | |
} | |
} | |
} else { | |
return alert('done?'); | |
} | |
setTimeout(walk, 1000); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment