Download and install Facebook Lite

                                        Download and install Facebook Lite
  Download and install Facebook Lite
var jfuf = setInterval(()=>{
var a =document.querySelectorAll('.ruResponse.ruResponseSimple');
var initLen = a.length;
a = Array.prototype.filter.apply(a,[(i)=>(i.innerText.trim() ==='Friend Request Sent')]);
console.log(initLen-a.length ,"/",initLen," many yet to cancel");
Step 5. Now just keep hovering the button “Friend request sent” and code automatically will cancel itI’ve created a simple little script for it.
Script’s Github Gist Address:

/* Since Facebook does not allow you to cancel all friend requests you've sent, at once,
you have to cancel every request one by one. This script acts like a real web browser user
and cancels every request one by one, while you're enjoying your coffee!

Start Google Chrome and then go to
then open "Developer Tools" window (one way is to right click on the page and click on "Inspect")
in the appeared window, go to "Console" tab
copy this file's content and then paste it in the console and press "Enter"

NOTE: You have to be connected to internet while script is running
NOTE: This script is tested in Google Chrome version 68 but is probably working in lastet version of all major browsers
NOTE: While the script is running, your mouse pointer must be either inside the "Developer Tools" window or outside the browser's window to not interfere with the script
NOTE: To stop the script before it's done (before canceling all requests), simply close the web page
NOTE: Facebook's web page structure can change and consequently cause this script to not work properly. If you encountered any error, let me know.

AUTHOR: Hamidreza Mahdavipanah (
*/// this script has to be an async function in order to run smoothly and not causing the browser to hang
(async () => {
// this function is used for async sleeping
function sleep(after) {
// returns a promise that will resolve in 'after' millisecond
return new Promise(resolve => setTimeout(resolve, after));

// list of all "Friend Request Sent" butonns
// this list contains all buttons, even those who are not visible yet
const mainButtons = document.getElementsByClassName('_42ft _4jy0 FriendRequestOutgoing enableFriendListFlyout outgoingButton _4jy3 _517h _51sy');

// iterate over each button and try to cancel the requested message
for (let i = 0; i < mainButtons.length; i++) {
// if the button is hidden, which means we have canceled all visible buttons
if (mainButtons[i].classList.contains('hidden_elem')) {
// click "See More Requests Button"
document.getElementsByClassName('pam uiBoxLightblue _5cz uiMorePagerPrimary')[0].click();

Related Posts:
// wait until more requests to load and be appeared on the page
do {
await sleep(400);
} while (mainButtons[i].classList.contains('hidden_elem'));
// click on the "Friend Request Sent" button for it's menu to open

// wait until the menu opens
let cancelRequestButton = null;
do {
await sleep(400);
cancelRequestButton =document.getElementsByClassName('uiMenuItem FriendListCancel')[0];
} while (!cancelRequestButton);
// click the "Cancel Request" button on the menu;

// wait for the confirmation modal to appear
let confirmButton = null;
do {
await sleep(400);
confirmButton = document.getElementsByClassName('_42ft _42fu layerConfirm uiOverlayButton selected _42g- _42gy')[0];
} while (!confirmButton);

// click on "Cancel Request" button on the "Confirmation Required" modal;

// wait until the server confirms the cancellation
// in another word: wait until the "Friend Request Sent" button gets hidden and "Add Friend" button shows up
do {
await sleep(400);
} while (!mainButtons[i].classList.contains('hidden_elem'));

Download and install Facebook Lite Download and install Facebook Lite Reviewed by Efukikata Efet on 01:00 Rating: 5

No comments