Facebook Posts Deleter updated – Greasemonkey script to delete FB posts one by one

Facebook archives all your posts, photos and videos to optical media, not just HDDs. So, when you tell them to delete your content, do they really delete it from its cold-storage system too? Unlikely. Delete Facebook, if you have one, now.

Facebook Posts Deleter 2016 was a User Script that automatically deleted Facebook posts one by one on the FB “Activity Log” page. You could use this script if you did not trust Facebook to delete the content when you choose that option on its page. One FB user, who sued Facebook, found that deleted content continues to reside on Facebook servers on its distributed content delivery network long after the account has been “deleted” by Facebook.

Like Google/YouTube, Facebook seems to be serving different set of web pages, CSS & JS for different versions of web browsers. This User JavaScript was developed and tested in Firefox 34. Spoof this version with a Firefox add-on. The code is now very simple. There is no start button. It will start deleting posts without warning.

// ==UserScript==
// @name Facebook Posts Deleter
// @namespace com.vsubhash.js.facebook-posts-deleter
// @description Deletes all facebook posts, one by one if browser is spoofed as Firefox 34
// @include https://www.facebook.com/*allactivity
// @exclude %exclude%
// @version 2018
// @grant none
// ==/UserScript==
/*
* "Facebook Posts Deleter 2018" script is a User Script to automatically delete Facebook posts one by one without any user intervention. Install this script in Firefox-based browsers (Firefox, Seamonkey, IceWeasel) using the Greasemonkey add-on. Then, go to your Facebook "Activity Log". This scripts was tested in Firefox 34. If you use a much different browser, it may not work as Facebook serves different web pages (CSS/JS) for different versions of browsers. To fix that, spoof your current browser as Firefox 34. For this, use a browser ID spoofer add-on (such as User Agent Overrider https://addons.mozilla.org/en-US/firefox/addon/user-agent-overrider/) and with the custom agent string "Mozilla/5.0 (X11; rv:34.0) Gecko/20100101 Firefox/34.0". This script was simplified and tested in 2018 and it works fine.
*/
document.addEventListener("DOMContentLoaded", startItDelayed, false);
function startItDelayed() {
window.setTimeout(clickTheMenu, 10*1000);
}
function clickTheMenu() {
console.log("FPD: Finding the menu");
arAnchors = document.getElementsByTagName("a");
for (var i = 0; i < arAnchors.length; i++) {
if (arAnchors[i].id.indexOf("u_jsonp") > -1) {
console.log("FPD: Found a menu");
arAnchors[i].click();
console.log("FPD: Clicked the menu");
window.setTimeout(clickDeleteOption, 3*1000);
break;
}
}
}
function clickDeleteOption() {
console.log("FPD: Finding the Delete option");
arAnchors = document.getElementsByTagName("a");
for (var i = 0; i < arAnchors.length; i++) {
if (arAnchors[i].hasAttribute("ajaxify")) {
if (arAnchors[i].getAttribute("ajaxify").indexOf("/ajax/timeline/delete/confirm") > -1) {
console.log("FPD: Found the Delete option");
arAnchors[i].click();
console.log("FPD: Clicked the delete option");
window.setTimeout(clickDeleteConfirmButton, 3*1000);
break;
}
}
}
}
function clickDeleteConfirmButton() {
console.log("FPD: Finding the Delete confirmation button");
arButtons = document.getElementsByTagName("button");
for (var i = 0; i < arButtons.length; i++) {
if ((arButtons[i].className.indexOf("layerConfirm") > -1) &&
(arButtons[i].textContent.indexOf("Delete") > -1)) {
console.log("FPD: Found the Delete confirm button");
arButtons[i].click();
console.log("FPD: Clicked the Delete confirm button");
window.setTimeout(function() { location.reload(true); }, 3*1000);
break;
}
}
}

Make a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s