Skip to content

Instantly share code, notes, and snippets.

@Erushenko
Forked from max-frai/remove.js
Created May 15, 2017 16:30
Show Gist options
  • Save Erushenko/ee774901712435ed8063f291e87a0761 to your computer and use it in GitHub Desktop.
Save Erushenko/ee774901712435ed8063f291e87a0761 to your computer and use it in GitHub Desktop.
Remove outgoing facebook friend requests
var interval = window.setInterval(function() {
var moreButton = document.querySelector('a[ajaxify*="outgoing/more"]');
if (moreButton)
{
moreButton.click();
console.log('loading more...');
}
else
{
//window.clearInterval(interval);
var outgoing = document.querySelector('button.FriendRequestOutgoing');
if (!outgoing)
{
window.clearInterval(interval);
console.log('FINISH');
}
else
{
try {
outgoing.click();
document.querySelector('li.FriendListCancel').click();
window.setTimeout(function() {
document.querySelector('button.layerConfirm').click();
outgoing.parentNode.removeChild(outgoing);
}, 500);
}catch(e) {console.log(e);}
}
}
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment