Skip to content

Instantly share code, notes, and snippets.

@nicerobot
Last active June 6, 2022 16:39
Show Gist options
  • Save nicerobot/ebd3f802e622fb105d55080821902896 to your computer and use it in GitHub Desktop.
Save nicerobot/ebd3f802e622fb105d55080821902896 to your computer and use it in GitHub Desktop.
JavaScript to Delete all (most) Facebook Activity as of 20201103
// 1. Navigate to your Activity Log
// 2. Paste this into the JavaScript Console
function clickDelete() {
document.querySelectorAll('[aria-label="Move to Trash"]')[0].click()
}
function clickMenu() {
document.querySelectorAll('[role="menuitem"]')[2].click();
setTimeout(clickDelete, 250);
}
function showMenu() {
document.querySelectorAll('[aria-label="Action options"]')[0].click();
setTimeout(clickMenu, 250);
}
var t = setInterval(showMenu, 750);
// To end it, run:
//
// clearInterval(t)
//
function clickDelete() {
document.querySelectorAll('[role="button"] div div span span').forEach(function (e) { if (e.innerText == "Delete") e.click(); });
}
function clickMenu() {
document.querySelectorAll('[role="menuitem"]')[2].click();
setTimeout(clickDelete, 500);
}
function showMenu() {
document.querySelectorAll('[aria-label="Actions for this post"]')[0].click()
setTimeout(clickMenu, 500);
}
var t = setInterval(showMenu, 1100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment