hacking facebook with javascript

1 07 2009

Hacking Facebook with Javascript

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:


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 this command:


Facebook Hack: Change profile colour

Check this out:

Isn’t that cool? Just use the following code to get your profile colour changed and impress your friends!


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, and it only lasts till you refresh the page, but it’s still worth it!

Facebook Hack: Get Chat History Even When Friends Aren’t Online

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: http://www.facebook.com/home.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:


(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:


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:


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!


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:


Bring up online friends list:


Bring up application tab:


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 language settings page 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:




44 responses

28 08 2009

Just wanted to say that you can’t be banned for doing this because the javascript you enter is almost exclusively client-side and so facebook doesn’t see a lick of it. It’s similar to using Javascript Injection (what you’re doing now) to bypass webforms and such.

17 02 2010

I followed the exact steps for retrieving facebook chat history as directed. first I tried on safari and on firefox from my macbook with javascript enabled. Are there settings on my facebook account I need to change as well or has facebook disabled this ability?
My second questions is do I need to be “online” to chat in order to perform history retrieval?
When I do as you say to do, when the person is online, the chat window pops up but no history and when they are offline the chat window pops up saying “john doe is offline” without history too.
OR is there an alternate way to retrieve the history even if you “chat” on other computers but still want to secretly log the histories without anyone knowing….?

2 03 2010

Can you still look up old chat history even if it has been cleared?

2 07 2010

ini apa?? q ga ngertiiii maksud nya,…

18 12 2010
Dusan Milutinovic

In fact the javascript code changed in:

javascript: void (document.getElementById (‘blueBar’). style.background = ‘red’);

9 01 2011
Tom Foolary

This is all crap!! none working you poo poo head foreigners

16 03 2011

please can any one give me the email and the password of 100000998583180 that id ?

9 06 2011

please can any one give me the email and the password of 100000937032756 that id ?

13 07 2011
prince roy

this is not work javascript:buddyList.itemOnClick();

24 08 2011
Nurul Aqilah Ridzal

it doesnt work on mine….

3 09 2011


10 09 2011

i try to do that but it wont work fr me javascript:buddyList.itemOnClick(1112222);
my email danfernandousa@gmail.com

12 09 2011

i try to do it wont work id number this is the correct id 749704452

12 11 2011


12 11 2011


27 03 2012

Hello! cdddekk interesting cdddekk site! I’m really like it! Very, very cdddekk good!

7 07 2012

ana 7awayak

16 08 2012
20 08 2012
african animals rugs

natural health bible for dog cat,ginseng animals,scott countys’-mississippi animals

16 11 2012

I am really loving the theme/design of your website. Do you ever run into any browser compatibility
problems? A couple of my blog readers have complained about my blog
not working correctly in Explorer but looks great in Safari.

Do you have any advice to help fix this issue?

7 01 2013
hacking facebook

Hi would you mind stating which blog platform you’re using? I’m looking to start my own blog
in the near future but I’m having a difficult time selecting between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your layout seems different then most blogs and I’m
looking for something unique. P.S Sorry for getting off-topic but I had to ask!

11 01 2013
facebook Hack

Thank you for some other informative blog. The place else could I am getting that type
of info written in such a perfect approach? I’ve a project that I am simply now running on, and I have been at the look out for such info.

14 02 2013

Thanks for applying some time in order to write “hacking facebook
with javascript ubay stenlly”. Thanks for a second time

24 02 2013

I intended to compose you this very small word in order
to say thank you the moment again relating to the awesome guidelines you’ve documented on this site. It’s really particularly open-handed of people like you to
give extensively what exactly most of us might have sold
as an ebook to generate some money on their own,
particularly seeing that you could have tried it in case you decided.

These techniques in addition acted like a good way to
recognize that most people have the same eagerness just like my very
own to grasp a whole lot more when it comes to
this matter. I am certain there are thousands of more pleasurable instances up
front for people who start reading your blog post.

6 03 2013
loan a kindle book

Just desire to say your article is as astonishing. The clearness for your
put up is simply spectacular and that i could suppose you are a professional on this
subject. Well together with your permission let me to grasp your RSS feed to keep updated with imminent post.

Thank you 1,000,000 and please keep up the rewarding work.

18 04 2013

Right now it appears like WordPress is the preferred blogging platform out there right
now. (from what I’ve read) Is that what you are using on your blog?

3 05 2013

We stumbled over here from a different web page and thought I should check things out.

I like what I see so now i’m following you. Look forward to looking at your web page yet again.

6 05 2013

Hi there, yes this article is actually fastidious and
I have learned lot of things from it concerning blogging.


10 05 2013
facebook hack password

Today, I went to the beach with my children. I found a sea shell and gave it to my 4
year old daughter and said “You can hear the ocean if you put this to your ear.”
She placed the shell to her ear and screamed. There was a hermit
crab inside and it pinched her ear. She never wants to go back!
LoL I know this is totally off topic but I had to tell

12 05 2013
Get Twitter User Data Back

Howdy outstanding website! Does running a blog such
as this take a great deal of work? I have absolutely no understanding of coding however
I had been hoping to start my own blog in the near future.

Anyhow, if you have any suggestions or tips for new blog owners please share.
I know this is off topic however I simply wanted to ask. Cheers!

24 05 2013
Toronto Couples Counselling

I am not certain the place you’re getting your information, however great topic. I needs to spend some time learning more or understanding more. Thank you for great information I used to be searching for this info for my mission.

25 05 2013
celebs without makeup

I’m extremely impressed with your writing skills and also with the layout on your weblog. Is this a paid theme or did you customize it yourself? Anyway keep up the nice quality writing, it is rare to see a great blog like this one today.

31 05 2013
Vivek Choubey

Well try out this javascript hack on any website:-

javascript:document.body.contentEditable=’true’;document.Designmode=’on’;void 0;

Now you can edit any thing on that page.Click on any textual material written on that webpage and you will see a blinking cursor.Now press backspace or any button,your browser will work like A NOTEPAD OR WORDPAD!!!

12 07 2013

Heya! I’m at work browsing your blog from my new iphone! Just wanted to say I love reading your blog and look forward to all your posts! Carry on the excellent work!

15 09 2013
seo gladiators review

Howdy! I understand this is sort of off-topic but I needed
to ask. Does managing a well-established blog such as yours require a large amount of work?
I’m completely new to operating a blog but I do write in my journal on a daily basis. I’d like to
start a blog so I can easily share my personal experience and views online.

Please let me know if you have any suggestions or tips for
brand new aspiring bloggers. Thankyou!

2 10 2013

Great blog you have got here.. It’s difficult to find quality writing like
yours these days. I seriously appreciate individuals like you!
Take care!!

28 11 2013
prada handbags

Moncler Outlet Online Store. Cheap Moncler Jackets, Moncler Coats and Moncler Vests
prada handbags http://www.alexcd.com/

19 09 2014

I wwas extremey pleasedd tto uncover tjis web site. I nee to to thank you for oneds time for this fantastyic read!!
I definitely svored evvery bit of itt and I have you save
to faav to seee new informtion inn you website.

28 08 2016

Thanks for the good writeup. It in truth used to be a enjoyment account it.
Glance complex to far added agreeable from you!
By the way, how can we communicate?

13 09 2016

Just want to say your article is as amazing.
The clarity to your submit is simply cool and that i could think you are
an expert on this subject. Fine along with your permission let me to take hold
of your feed to stay updated with approaching post.
Thanks a million and please keep up the rewarding work.

12 01 2017
Lan Tegtmeier

Nice site!

14 01 2017
indice eficiencia energetica aire acondicionado

Se requiere con urgencia, Diseñador gráfico especializado enfocado en Web con 2 años de experiencia profesional y específica en diseño de interfaces gráficas Web para portales Sistemas de Información y diseño de piezas publicitarias digitales. El mismo será el encargado de efectuar los cobros, realizar el análisis crediticio y las tareas administrativas en general.

11 06 2017

An impressive share! I’ve just forwarded this onto
a coworker who had been conducting a little homework on this.
And he actually ordered me dinner because I found
it for him… lol. So let me reword this….
Thanks for the meal!! But yeah, thanx for spending time to discuss this subject here on your
internet site.

16 06 2018

Since just seems like wise practice nonetheless it is wonderful how little commencing people
think about this fact entirely before buying into a game.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )


Connecting to %s

%d blogger menyukai ini: