Confirm Friend Request on Facebook All At Once

Popular on Facebook? So you have got 100s of friend requests pending on your Facebook profile, confirming them one by one can be a pain. This small block of JavaScript code can save you time and energy.


Before we start I want to tell you that it's not guaranteed this code might work in the future. If Facebook's website structure changes, there's a possibility that this code might become obsolete, but that doesn't mean you can use a script to do that, we will work on a new script and update it on the blog.
Last Tested: 28 September 2014 (Works)



But for now this code must work perfectly for confirming all the friends request at once. Login to your Facebook profile and go to the friend requests page where you can view your pending friends requests, use either Mozilla Firefox or Google Chrome or Safari.

Keep showing up more friend requests pending by clicking on "Show more" button until you reach the end.

The Magic Charm (JavaScript Code)

var confirmBtns = document.getElementsByTagName('button');
for (var i = 0; i < confirmBtns.length; i++) {
    if (confirmBtns[i].innerHTML == "Confirm") {
        confirmBtns[i].click();
    }
}

Copy the JavaScript code





Now Run The Code

We assume you have the code snippet on your clipboard, copied. Now you need make use of the developer tools in the browser.

Developer tools are small set of tools use to debug web sites. To learn more about using developer tools see - How to open developer tools.

To open Developer Console

Press CTRL+SHIFT+J (for Chrome), CTRL+SHIFT+K (for FireFox) to open the JavaScript Console.


Paste the code in the console and press enter to run the code. If done correctly your pending friend requests will get confirmed one by one in a matter of seconds.

Note: Facebook might show up a big warning message to do not copy-paste codes and tell you it might be scam and yes never ever run suspicious or codes not from trusted sources in the console, the scripts can do malicious things on your Facebook account.