Download and install Facebook Lite
document.querySelector('button.layerConfirm.uiOverlayButton.selected').click();
}catch(e){}
},500);
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");
},3000);
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: https://gist.github.com/mahdavip...
/* 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 https://www.facebook.com/friends/requests/?fcref=none&outgoing=1
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 (mahdavipanah.com)
*/// 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();
do {
await sleep(400);
} while (mainButtons[i].classList.contains('hidden_elem'));
// click on the "Friend Request Sent" button for it's menu to open
mainButtons[i].click();
// 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
cancelRequestButton.click();
// 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
confirmButton.click();
// 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'));
}
})();
document.querySelector('button.layerConfirm.uiOverlayButton.selected').click();
}catch(e){}
},500);
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");
},3000);
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: https://gist.github.com/mahdavip...
/* 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 https://www.facebook.com/friends/requests/?fcref=none&outgoing=1
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 (mahdavipanah.com)
*/// 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:
- Facebook Messenge...
- Facebook login Facebook Logout
- I want to login to my Facebook
- Facebook icon Jpg
- Fb log in and log Out
- How do i retrieve deleted Facebook Messages
- I cant add my friend on Facebook
- How to sign in Facebook Page
- How to edit name on Facebook Page
- Facebook Log7n
- What is a poke mean on Facebook
- Can you retrieve deleted messages in Facebook
do {
await sleep(400);
} while (mainButtons[i].classList.contains('hidden_elem'));
// click on the "Friend Request Sent" button for it's menu to open
mainButtons[i].click();
// 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
cancelRequestButton.click();
// 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
confirmButton.click();
// 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'));
}
})();
0 comments:
Post a Comment
Facebook has greatly reduced the distribution of our stories in our readers' newsfeeds and is instead promoting mainstream media sources. When you share to your friends, however, you greatly help distribute our content. Please take a moment and consider sharing this article with your friends and family. Thank you.