Click here to Skip to main content
11,924,280 members (60,513 online)
Click here to Skip to main content
Add your own
alternative version


37 bookmarked

Bored by Hotmail?

, 26 Oct 2004
Rate this:
Please Sign up or sign in to vote.
A workaround to escape the "Your email message has been idle" when clicking a link in a hotmail message that has been displayed for more than five minutes


This idea came up because I was bored by Hotmail's standard behaviour.

Every month I get the newsletter from CodeProject. These emails are pretty lengthy and contains several links. I read them using hotmail in a browser. When I follow one link I study the article for some time(5 min) and then closes the window. Now I want to read the next link in the newsletter but Hotmail gives me a popup-window as seen above stating that "this link has become inactive".

This is wrong, the link is active. CodeProject has not removed it. You can get around this by hitting the Refresh button of the browser but it is very annoying! You don't get around the fact that hotmail replaces the original links in your messages with a URL to one of their servers taking the original link as parameter. This is suggesting that hotmail is logging what links you visit!!!

This is Freakin' Spyware behaviour to me!!!

The Hack

I searched around for away of extending the capabilities of Internet Explorer and I found this article describing a way to Control the Context Menus. Items can be added to the existing context menus of the WebBrowser Control by placing entries in the registry and linking these to URLs that execute script.

To add items to the standard WebBrowser Control context menus, create or open the following key:

                Internet Explorer

Under this key, you create a key whose name contains the text you want displayed in the menu. The default value for this key contains the URL that will be executed. The key name can include the ampersand (&) character, which will cause the character immediately following the & to be underlined

The following registry entry adds an item with the title Open Hotmail Link to the WebBrowser Control context menu and executes the inline script contained in the file c:\hotmail.js.

                Internet Explorer
                        Open Hotmail Link = "file:///c:/hotmail.js"
                        Contexts          = dword:0x20

The "Contexts" DWORD value specifies the context menus in which an item will appear. In this case 0x20 is corresponding to CONTEXT_MENU_ANCHOR, the menu item will only be visible when you right clicked a hyperlink.

Now we have a way of invoking a JavaScript file by right clicking the hyperlink in the hotmail message. Let us consider the format of the hyperlink and restructure it using JavaScript.


The first three lines above is added by hotmail and not of interest to us. The fourth line however contains a parameter called hm___action which is set to the value of the link as it was intended by the person or machine that sent the email.

First we obtain the link that was clicked.

//Obtain the hyperlink clicked
var oSource = external.menuArguments.event.srcElement

var str = new String(oSource.href);

Now the link is scanned for the first occurrence of the string "hm___action=".

//find the index of "hm___action=" in string
var i = str.indexOf("hm___action=", 0);

//if "hm___action=" was found then ...
if (i != -1)

//Cut away stuff added by hotmail
str = str.substring(i + 12, str.length-3);



The indexOf method finds the location of "hm___action=" inside str and tells you where the substring starts. If the string doesn't contain the substring, indexOf returns -1. The index i is then advanced by twelve, which is the number of characters in the string "hm___action=". Since the data of interest is located between i and the end of the string, except the last three chracters, str.length-3, a simple call to the substring method is used to extract it.

The value of str in our example is now.


The original link has been URL encoded so lets URL decode it.

str = unescape(str);

After this operation the link is now in its original state before Hotmail meddled with it and all we have to do is to open it in a new browser window

Now you can invoke the JavaScript on any link, not just hotmail, but it will only work its magic if the parameter hm___action is found.


In the downloads at top you will receive a zip archive containing two files.

  • hotmail.js
  • hotmail.reg

The hotmail.js should be placed in C: directory. The hotmail.reg should be run to add the correct key and values to the registry. Don't forget to close all browser windows before trying out the hack. I hope it can be off some help. I know the problem bugged the hell out of me.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Sweden Sweden
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralWooHoo!!!! Pin
patnsnaudy1-Dec-04 5:12
memberpatnsnaudy1-Dec-04 5:12 
GeneralRe: WooHoo!!!! Pin
aalo24-Jan-05 22:31
memberaalo24-Jan-05 22:31 
GeneralReally Nice..... nearly Pin
Roydy3-Nov-04 1:53
memberRoydy3-Nov-04 1:53 
GeneralRe: Really Nice..... nearly Pin
aalo8-Nov-04 23:22
memberaalo8-Nov-04 23:22 
GeneralNice, but Pin
skjagini29-Oct-04 17:24
memberskjagini29-Oct-04 17:24 
GeneralRe: Nice, but Pin
aalo1-Nov-04 2:16
memberaalo1-Nov-04 2:16 
GeneralGreat work Pin
mbeatini26-Oct-04 3:29
sussmbeatini26-Oct-04 3:29 
GeneralRemaining Characters html'); Pin
jerry_j_usa19-Oct-04 16:22
sussjerry_j_usa19-Oct-04 16:22 
GeneralRe: Remaining Characters html'); Pin
brabchev21-Oct-04 3:27
memberbrabchev21-Oct-04 3:27 
GeneralRe: Remaining Characters html'); Pin
aalo21-Oct-04 4:05
memberaalo21-Oct-04 4:05 
GeneralRe: Remaining Characters html'); Pin
Anonymous23-Oct-04 22:10
sussAnonymous23-Oct-04 22:10 
GeneralRe: Remaining Characters html'); Pin
aalo26-Oct-04 4:01
memberaalo26-Oct-04 4:01 
GeneralMine isnt working Pin
magicmike00728-Sep-04 19:35
membermagicmike00728-Sep-04 19:35 
GeneralRe: Mine isnt working Pin
aalo28-Sep-04 21:40
memberaalo28-Sep-04 21:40 
QuestionHow to mass-forward this files? Pin
Dragonlord_kfb21-Sep-04 12:07
memberDragonlord_kfb21-Sep-04 12:07 
GeneralYou are Jesus! Hurray. Bill G. owes you money! Pin
John Dresty29-Jun-04 17:57
sussJohn Dresty29-Jun-04 17:57 
QuestionMozilla? Pin
hlaford15-Apr-04 11:31
memberhlaford15-Apr-04 11:31 
AnswerRe: Mozilla? Pin
aalo15-Apr-04 23:15
memberaalo15-Apr-04 23:15 
GeneralRe: Mozilla? Pin
aalo16-Apr-04 1:35
memberaalo16-Apr-04 1:35 
GeneralRe: Mozilla? Pin
aalo7-Jul-04 1:38
memberaalo7-Jul-04 1:38 
GeneralThanks so much Pin
effalump28-Mar-04 11:25
membereffalump28-Mar-04 11:25 
Generalgood!! Pin
Anonymous27-Mar-04 23:52
sussAnonymous27-Mar-04 23:52 
GeneralOutstanding Pin
Martin MMM26-Mar-04 2:50
sussMartin MMM26-Mar-04 2:50 
GeneralGreat! Pin
worshiprick22-Mar-04 3:20
memberworshiprick22-Mar-04 3:20 
Generalfor image anchors it fails Pin
Anonymous Poster21-Mar-04 20:22
memberAnonymous Poster21-Mar-04 20:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.151125.3 | Last Updated 26 Oct 2004
Article Copyright 2004 by aalo
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid