Skip to content

Instantly share code, notes, and snippets.

@AymaneHrouch
Last active May 12, 2020 17:52
Show Gist options
  • Save AymaneHrouch/d011ea2ddac73e5abf1c32d2d05f8b3f to your computer and use it in GitHub Desktop.
Save AymaneHrouch/d011ea2ddac73e5abf1c32d2d05f8b3f to your computer and use it in GitHub Desktop.
Bookmark to cancel pending sent requests on Facebook.
// COPY JUST THE LINE BELOW //
javascript:var validUrl = new RegExp("https://m(obile)?.facebook.com/friends/center/requests/outgoing.*"); if(validUrl.test(document.URL)){if(confirm("Are you sure?\nPress OK to confirm")){var requestsNumber = document.querySelectorAll('[data-sigil="undoable-action"]').length; for (var i=0; i < requestsNumber; i++) {document.querySelectorAll('[data-sigil="undoable-action"]')[i].children[1].children[0].children[2].children[2].children[0].click(); } alert(`${requestsNumber} request has been cancelled successfully`);}}else{if(confirm("Press OK to be redirected...")){window.open("https://m.facebook.com/friends/center/requests/outgoing");}}
// COPY JUST THE LINE ABOVE //
/*
PLEASE READ BELOW INSTRUCTIONS:
-Make a new bookmark and paste that line in the URL field, choose any title you want
-You can go to "https://m.facebook.com/friends/center/requests/outgoing/" manually
-Or you can just click the bookmark wherever you are and it will redirect you
-After you have been redirected (or went manually), scroll as much as you can and then click the bookmark.
-You are welcome :)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment