source files - 1 Kb
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!!!
I searched around for away of extending the capabilities of Internet
Explorer and I found this article describing a way to <a
href="http: msdn.microsoft.com="" workshop="" browser="" overview="" overview.asp?frame="true#Controlling_the_Cont"">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:
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
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
Open Hotmail Link = "file:///c:/hotmail.js"
Contexts = dword:0x20
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.
hyperlink in the hotmail message. Let us consider the format of the
hyperlink and restructure it using
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.
var oSource = external.menuArguments.event.srcElement
var str = new String(oSource.href);
Now the link is scanned for the first occurrence of the string
var i = str.indexOf("hm___action=", 0);
if (i != -1)
str = str.substring(i + 12, str.length-3);
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
the end of the string, except the last three chracters,
str.length-3, a simple call to the
is used to extract it.
The value of
str in our example is
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
work its magic if the parameter
In the downloads at top you will receive a zip archive containing two
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.