Created
December 17, 2012 21:59
-
-
Save koudelka/4322700 to your computer and use it in GitHub Desktop.
Deletes all Facebook friend requests, execute on https://www.facebook.com/friends/requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x = document.evaluate('//input[@value="Delete Request"]', document.documentElement, null, XPathResult.ANY_TYPE, null); | |
// gotta build an array of the elements, iterators throw exceptions if you modify the DOM from under them | |
var elements = []; | |
var thisNode = x.iterateNext(); | |
while (thisNode) { | |
elements.push(thisNode); | |
thisNode = x.iterateNext(); | |
} | |
elements.forEach(function(e) { | |
e.click(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment