Select more than 50 Friends on Facebook using JavaScript

Some months back I wrote a post that shows how to select all friends at once on Facebook using a small JavaScript snippet and it works good but there's one problem that needs to be fixed and this post is about it.
Writing a Facebook post after a long time. People uses Facebook to keep up with their friends and families, you can create events and invite others to your event but the inviting section is very boring as you have to select one and every check box manually and if you have 1000s of friends then it's sure you are going to have a bad time. But with some smart codes we can let the computer do all the selecting for us.

The script I provided in this post worked great for many people http://www.stramaxon.com/2012/02/how-to-select-all-friends-at-once-to.html . But one problem that everybody reported me was that they can only select 50 people at once (this is the number of people appears by default in invite box). It's is very easy to get rid of these problem and select all of your friends by only running the script once. Let's recall the script and then we will learn how to solve this problem.

This is the JavaScript code you may have used to invite all friends at once :
javascript:elms=document.getElementsByName("checkableitems[]");for (i=0;i<elms.length;i++){if (elms[i].type="checkbox" )elms[i].click()};
And if you don't know how to use this code then check the link above.

How to select all friends at once

No, you don't have to use another code to do this. To better understand the trick I suggest you to watch the screencast. First the writing tutorial and then the video.

Tutorial

It's is very easy, just read every instruction carefully to be successful.
  1. Create an event and then click on the 'Invite Friends' button on the top right corner.
  2. Wait for the box with the name of your friends to be opened
  3. When it's completely loaded, select the first check box
  4. And without clicking anywhere outside the box press and hold Page Down button on your keyboard, it is just above your arrow keys.
  5. Hold it until the complete list of your friend appears in the box. 
That's great, now all you friends are visible in the invite box, so now when you run the code it will select every one. Great, it's now easier for you to invite all your friends.

Video Tutorial



Anyways, some people using different browsers were having difficulties opening developer console on their browser, so here's a list of browsers and the command to use to open the developer console.

  1. Google Chrome - CTRL+SHIFT+J
  2. Mozilla Firefox - CTRL+SHIFT+K
  3. Safari - CMD + OPT + C [mac] / CTRL + ALT + C [win]
If your browser isn't listed here, you can check your browser's documentation online for help.