JavaScript workaround to clear Facebook Chat history
Update: As of the late evening of October 15, 2010, Facebook listened to our petition and has restored the link to Clear Chat History! Chalk another one up for the Good Guys! The link is in the top right of your Facebook Chat boxes. It only works on your end. If you want your chat partners to clear their side, ask them to do so. Otherwise, your comments remain online.
Updated with more details, on October 15, 2010, at: 10:45 AM, EST.
At the time I am writing this, Facebook does not have a means of clearing your Facebook Chat history. It is preserved over an undisclosed period of time, so that every time you close the browser, then open it again and login to Facebook, then open a Chat with a Friend, your previous chat history will still be present. This is a serious security and privacy risk. If somebody else uses your computer, and opens the same browser and goes to your Facebook page (Facebook automatically logs you in every time!), they can open the Chat box and click on names of your Friends. Each Friend with whom you have recently chatted will reveal the entire chat history, until the Facebook servers finally delete it.
If the person reading your Facebook page is your employer, or a spy, or a jealous companion, they can read every word exchanged between you and your Chat partners. If you allow third party Facebook applications to access your profile, they can also access your chat history!
There is an ongoing petition, based on Facebook members "Liking" the topic, about getting Facebook to reinstall the previously present, now removed link to delete individual chat histories. I have posted several comments about this matter. Now, there is a workaround being discussed, involving a snippet of JavaScript and copying/pasting it into the browser's address bar while viewing a Chat partner's profile. It is confusing to the less technically savvy Facebook users. I shall try to 'splain it in plain English.
Here is part of what a Facebook member posted. It works for me and some others, but confuses the hell out of too many members.
have the chat box of the person you're chatting with open or minimized. go to their profile.
{snip}
copy and paste the line below and replace their id in the address bar with the number after id= and hit the enter key. {snip}
javascript:chatDisplay.tabs[id].clearHistory();
I just tested that (full) procedure and it worked as advertised, but took extra steps that were not described in detail. Here are the actual steps I took, in outline form:
- With the Chat box open and the Chat history present, right-click on that person's small photo inside the Chat box;
- From the flyout right button options, use the left button to select "Open in new tab" or else "Open in new window", depending on if your browser allows you to use new tabs for opening hyperlinks.
- Look at address bar on the new browser tab or window, where the link from the profile picture opened. The address bar or location bar as it's called in Firefox, is where the URL of a web page is shown. E.g.: http://whatever.com. On right half of the Facebook URL there is "/profile.php?id=" - without the quotes, and either their Facebook user name or a long series of numbers;
- Click the mouse pointer on the first number after the = symbol, hold down left mouse button, then wipe mouse to the right, across all the rest of the member's name or numbers, then let go of mouse button;
Example: If the address bar shows /profile.php?id=123456789012345, you would want to highlight just the group of numbers I have underlined. If the ID is the actual member's name, rather than a number code, copy it instead. - Press CTRL and C together on your keyboard, to copy the now highlighted user id name or number
- Open Notepad, or another text editor.
Windows method: Right-click your mouse or pointer anywhere in a blank area of your desktop display and hover the pointer over New, then move sideways to the little down arrow that appears and go down the list of options until you highlight Text Document. With your left mouse button, click to select Text Document. This will open a blank instance of Windows Notepad.
Now, paste in the copied name or numbers by pressing the CTRL and V keys together. - Hit the Enter key to create a new line in the new Notepad document window
- Highlight, Copy (Ctrl and C) and Paste (Ctrl and V) this code into a new line in the Notepad document:
javascript:chatDisplay.tabs[id].clearHistory(); - Highlight and delete the letters [id] inside the square brackets, but not the brackets themselves.
- Highlight and re-copy the ID name or numbers you copied and pasted into Notepad, in step six (from the member's Facebook ID)
- Paste those numbers inside the square brackets where the word "id" was before you deleted it. Here's how it would look in my example id:
javascript:chatDisplay.tabs[123456789012345].clearHistory(); - Now, copy and paste that code, but with the member's actual name or ID number in the brackets, into the address bar where that member's profile page was opened, in step #2, overwriting the existing facebook.com URL. You must replace the URL that was in the address bar with this code. Do not just add it in.
- With that JavaScript code in the address or location bar, press the ENTER key. If the Chat box is open on the other person's profile page, you will see the entire chat history disappear in front of your eyes!
Instructions for newbies, for copying and pasting, are in my extended comments, below.
A quick tutorial on how to highlight, copy and paste text in text documents.
You are reading this because you were instructed to copy and paste some text, or code, from one place into another, and is is Greek to you. I will try to explain it in plain English.
Copying and pasting text involves several keyboard combinations, and/or mouse/pointer actions, as follows. This is how I do it.
- Highlight the desired text with your mouse or pointer.
Do this by clicking and holding down the left mouse/pointer button at start of the word, code, line, or entire paragraph(s) of characters, then move the mouse or pointer sideways (and down for multiple lines) to the other end of the desired sequence to be copied. When you reach the end of the section, stop moving and let go of the left mouse button. If the letters are dark, on a light or white background, like on this blog, the selection you wiped the mouse pointer across will be highlighted in a dark blue color and the letters and characters will change to white. If the page you are copying from has light letters on a dark background to begin with, highlighting will produce an opposite color scheme. - Copy the highlighted text to a virtual clipboard that holds it temporarily.
Press the Ctrl and C keyboard keys together - Using the left mouse/pointer button, click in the location, page, paragraph, space between words, input field, address bar, or document, where the copied selection is to be pasted.
- Paste in copied text by pressing the Ctrl and V keys together.
Note: you can instantly highlight all of the text on a page, or inside a text field, by pressing the Ctrl and A keys together.
If you have difficulty controlling the mouse pointer when highlighting sections, or lines of text. you can use the keyboard instead. It will simplify things if you are able to at least left click with your pointer, or trackball and left button, at the general place where you want to copy text. Then, use the up/down and left/right arrow keys to get to the starting point. Press the Shift key and hold it down with your left hand, then use the arrow keys, or the Home, or End key to highlight as much text as desired. With the text highlighted, use the aforementioned combination of Ctrl and C to copy, and Ctrl and V to paste it in elsewhere.
That's all I've got to say about tha-at! Remember, you learned this from Wiz Feinberg, on Wiz's Computer and Website Security Blog. My home page is at http://www.wizcrafts.net.
If you like this article please share it.
The content on this blog may be reprinted provided you do not modify the content and that you give credit to Wizcrafts and provide a link back to the blog home page, or individual blog articles you wish to reprint. Commercial use, or derivative work requires written permission from the author.