Hacking Facebook with Javascript
now updated for the latest (March 2010) version of facebook!
Because facebook relies so heavily on javascript, and because we can type javascript into the address bar, that means we can “poke” into the workings of facebook to do things that we wouldn’t normally be able to do. It’s not “hacking” exactly, but it employs the same sort of skills hackers use when looking into applications. The best part is that because it’s all using the same control codes (or “API”) that facebook uses, there’s no way for facebook to find out you’re doing it, so it’s totally safe! (I think…) Besides, we’re not going to be doing anything too dodgy, just a few little tweaks ;)
Facebook Hack: Sending your friends offline
Here’s a funny one; if you’re chatting to a friend, get them to paste the following code into their facebook address bar:
javascript:buddyList.toggleTab();
It’ll make them go offline! Of course it’s not permanent, they can go back online by clicking the icon as normal, or by giving the same command again
Facebook Hack: Change facebook color
Check this out:
Isn’t that cool? Just use the following code to get your profile colour changed and impress your friends!
javascript:void(document.getElementById('headNavOut').style.backgroundColor="red");
Of course, you can use any colour you like; green, yellow,orange, black. It’s also fun to change it to “white” so you can’t see the text. Muahahaha. Again, only you can see it, but it does last until you log out or view certain special pages.
Facebook Hack: Get Chat History Even When Friends Aren’t Online
New: Video Tutorial for this hack.
Here’s a facebook hack that’s actually proven very useful to me in the past. One thing that I find annoying about facebook is that you can’t retrieve chat history if your buddy is offline… well now you can! :)
Click onto your friend’s profile page and copy their facebook ID from the address bar; i.e. the number after “id=”, highlighted in red below:
It might look slightly different, perhaps like this: .php#/profile.php?id=123132132213&ref=nf
But the important thing is to copy the number of the user, in our case 123132132213
Then while you’re still on facebook, type this into the address bar:
javascript:buddyList.itemOnClick(123132132213);
(with the correct ID of course)
And their chat window will pop up, saying “Jimbo is offline”. And if there’s any chat history, it will be displayed. How neat is that!
You can even open a chat window to yourself by pasting your own ID into the javascript, as seen to the right. You can use it for little notes to yourself, but remember that facebook chat history is cleared every few days, so don’t rely on it.
UPDATE1: A few people have had trouble pasting it in correctly, so here’s how it should look:
UPDATE2: Now that we have facebook usernames, it can be little harder to determine the ID of a profile, but it’s still possible – here’s one way: right click the “see all” friends link and choose “copy link location”, like so:
Or in Internet Explorer, you can choose “open link in new tab”. The resulting URL will look something like this:
?id=YOUR_ID_HERE&view=everyone
That’s it!
Facebook Hack: Change your name (temporarily)
This one’s a very simple hack that you can apply to any website. As you saw in the screenshot above, I’d changed my facebook to display as “Facebook | Leet Hax0r”. You can do this by using the following javascript:
javascript:void(document.title="Facebook | Neo");
Sadly, your friends will only see your actual name, not the new one, but it can make for some amusement in a computer lab class or anywhere where you can show people face to face.
Facebook Hack: Close chat windows
If you’re chatting to a friend and want to close the window, sure you can just click the ‘x’ in the top corner, but isn’t it cooler to do it with javascript? Well no not really, but if you can trick your friend into typing the following code in, you can close the chat window of anyone they’re chatting to:
javascript:chatDisplay.tabs[123132132213].tabXOnClick();
That will close my chat with “123132132213″. You can send your friends that link with your own facebook ID in it, and it’ll close their chat window with you! And if you happen to know that ID:123 is chatting with ID:321, you can send the following to ID:123, and when they paste it in it’ll close their chat with 321!
javascript:chatDisplay.tabs[321].tabXOnClick();
Other Facebook Hacks
The hacks above are the most impressive, but there are a few other little things you can do which are mildly interesting:
Bring up notifications:
javascript:presence.toggleTab('chat_status_control','chat_status_control_tab');
Bring up online friends list:
javascript:buddyList.toggleTab();
Bring up application tab:
javascript:applicationDock.toggleTab();
Make text bold or underlined in facebook chat: use *stars* for bold text, and _underscores_ for underlined. There is no way to get italic text on facebook; see my comment here about facebook chat italics.
That’s all the hacks I’ve found (but I know there are more). In fact, it’s possible to get your friends to “like”, or “unlike” items, and I think it would be possible to get them to comment and more, but the complexity of the javascript makes it not worth doing, plus you have to get them to paste code into their address bar – there’s no way to do it without getting them to do that.
Facebook Easter Egg: Pirate Language
Here’s a nice little facebook easter egg for you:Â Go to the and scroll to the bottom of the list of languages, and somewhere around there you should see “English (Pirate)” in the list of supported languages.
Choose that language option and avast ye sails fer much facebook silliness.
Facebook Easter Egg: Konami
This one is awesome, thanks to Jim in the comments for letting me know about it.
Click in your status update box and type the following: [up] [up] [down] [down] [left] [right] [left] [right] b a [enter], and then click anywhere on the page to see lensflares:
Facebook Chat Smilies
There are a whole load of facebook emoticons available in the chat window. Here’s the complete list decribing what facebook smileys there are and how to display smilies in facebook chat. This seems to have been first discovered by 20bits.com. This list includes the shark smilie and the new facebook penguin smiley!
:) | :( | :P | :D | ||||
:o | ;) | 8) | 8| | ||||
>:( | :/ | :’( | 3:) | ||||
O:) | :* | <3 | ^_^ | ||||
-_- | o.O | <:o | :v | ||||
(^^^) | :3 | :|] | :putnam: | ||||
<(“) |
I hope you enjoyed that post, please thumb me up on stumbleupon or digg me if you liked it :) Happy Hacking! If you want to learn how to hack, I also have a little hacking tutorial online that you might enjoy.
#1 by lacie on March 8, 2010 - 1:42 pm
The color changing thing doesn’t work for me, is it because I have Internet Explorer? I copy/pasted it 3 times to no avail. :/
#2 by sarah on March 8, 2010 - 10:56 pm
You don’t copy and paste, they’re instructions! The up down left right’s are the sequence you move your keypad, then you type ba and then you click enter, it should work even on internet explorer :)
#3 by Jonus Blaster on March 30, 2010 - 8:47 am
Clear the address bar and then paste the code, that should work :-)
#4 by Madcat on March 12, 2010 - 11:41 am
Kid’s , it is illegal . Your I.P. address will be at main-frame in sec’s . Think hard ,
#5 by Cullen on March 17, 2010 - 2:30 pm
Stop talking about hacking into someones account. Its not that hard in most cases as long as you know the person pretty well. Ya’ll are starting to sound a little … stalkerish?
Ohhh yeah, the javascripting modifications on here are actually pretty amusing as are the language settings :-) Good Job
#6 by hakan on March 26, 2010 - 5:17 pm
i have a big problem, someone has hacked my facebook account and i need to hack back into it because i have changed email adress so have forgotten the password for the hotmail i use on facebook, how can i hack into my account for facebook???????????x
#7 by tuzo desdery on March 27, 2010 - 11:20 pm
men those stuffs don work when i try after typing say javascript:buddylist,toggleTab();, are you supossed to do what cos aftr that i do click the go or enter icon bot the computer isnt even loading why so???
#8 by hailey on April 8, 2010 - 10:39 am
;’() <3
#9 by Chris on April 18, 2010 - 7:16 pm
Hey Guys. Chat question. Seems theres a few people im no longer able to chat to and vice versa. Just comes up with ‘an error occured’ – yet im able to speak to almost any other persons on my online chat list. Any help?
#10 by Howard Yeend on April 19, 2010 - 12:13 am
I don’t know. You could try the chat history trick with their ID, but honestly it will probably just give you the same message.
#11 by stalker on April 19, 2010 - 12:36 am
Hello guys..this script used to work wonderfully and used to show a paragraph of chat but now it is not working can anyone tell the fix of this soon?
#12 by Howard Yeend on April 19, 2010 - 4:00 am
FB has probably cleared your chat history.
#13 by Chris Brown on April 21, 2010 - 1:57 pm
How can I see comments and pix from someone who has blocked me?
#14 by moomoodj on April 29, 2010 - 1:14 am
can you hack like your friends like you have 13 then hack it to like 45 million
#15 by debby tuck on April 30, 2010 - 7:11 am
i need to print some comments someone made about a picture, but not on my facebook page on someone else’s..when i went on their page today to print them off they had been deleted..Isn’t there a way to research it by date to recall the comments>?
#16 by jonny on May 4, 2010 - 11:32 pm
come on people….! if you want to know how many people viewed your profile, you need to put in a code in the server that has a counter that keeps track of how many viewed it, and if you could just go into any server and change anything you want, why didn’t anyone hack the government and make themselves rich?
btw to change the theme, add the “stylus” extension to firefox or chrome, then follow the instructions.
nice article btw
#17 by Nick on May 6, 2010 - 2:24 am
Thumbed you up esp since you asked for it. Don’t you just love stumble!
Great tricks!
#18 by Howard Yeend on May 6, 2010 - 10:03 am
Thanks, I appreciate it :D
#19 by NATHAN on May 6, 2010 - 6:14 pm
wow! good tutorial for anyone!
#20 by rahul on May 12, 2010 - 9:58 pm
its ooosome for biginners tri it
#21 by steveei on May 17, 2010 - 7:50 pm
“In fact, it’s possible to get your friends to “likeâ€, or “unlike†items” can you give out the code for that?
#22 by ASN on May 30, 2010 - 12:53 am
Is there any way that I can retrieve my deleted status back?
#23 by sammm on June 1, 2010 - 7:27 pm
how do you retreive deleted messages from your inbox? i was hacked by someone who started a bunch of stuff and deleted all my messages and i need them back
#24 by Andy Smithson on June 14, 2010 - 12:36 am
can I get to the chat history of someone who is not a freind or who has blocked me ?
#25 by ninjaha on June 14, 2010 - 7:34 pm
lol i did it to my friend and he got so scared he thought the computer stuffed up lol
#26 by lyn.k on June 17, 2010 - 5:12 am
My facebook keeps reloading and reloading… until I sign out of the browser and sign back in. When I back up or open a new tab for someone elses Facebook Profile, it starts doing it again. I have done a complete system scan from Nortons multiple times and it does not fix this problem. I think I downloaded a Java Script that I wasn’t aware of on Facebook.
#27 by dylan on June 17, 2010 - 7:26 pm
You can also change the language to leet speak
L4n9u493 = language
#28 by ansh on July 7, 2010 - 10:45 am
hey !!!
Is there any way to get back to the pages u scrolled at facebook , after you signout. Again you want to check those pages (with same status as you veiwed earlier) !!!!!!!
#29 by Carl Hayden on July 9, 2010 - 12:33 pm
Question: Is old chat IM saved on my computer or on Facebook server? Is there anyway to see old buddy IM chats after you have deleted them from your buddy list?
#30 by paul bender on July 24, 2010 - 8:35 am
The trick for viewing chat history just won’t work for me: all that happens is the person comes up in the chat window but it just says “(so n’ so) is offline…and I just chatted w/this person yesterday!
#31 by lee on July 28, 2010 - 4:23 am
how to see the profile of somebody ,even the private pix?
#32 by Sam Kelemen on July 30, 2010 - 7:26 pm
u forgot :42: in emoticons it is a red 42 box
#33 by Alan on August 2, 2010 - 7:53 pm
Great tips :) However there are people on FB who are currently hacking peoples accounts and it would be greatly appreciated if we are able to hack them back. Two names have been given so far but I can only assume that they have keylogged people with the stupid apps on FB. I have known several times for javascript codes to have been used and wondering if this has anything to do with the hacking of peoples accounts?
#34 by on August 4, 2010 - 6:58 am
All or some of them don’t work in Internet Explorer
#35 by shadow on August 7, 2010 - 6:09 am
i coundnt get the lens flares to work
#36 by kc on August 7, 2010 - 8:29 am
how to retrieve previous wall post taken down by FB or author? I did not even get the customary email – I want that post! HELP PLZZZ
#37 by how to hack facebook on August 8, 2010 - 3:49 am
It’s been a while since I’ve used my FB but I’ll give this a try for sure!
#38 by amadtattoo on August 17, 2010 - 2:38 pm
great, thanks a lot puremango..