Extend Internet Explorer context-menu

The right-click popup-menu in Internet Explorer (IE) can be extended to provide even more useful actions than it has already. Extensions are added through the registry:

[HKEY_CURRENT_USER \Software \Microsoft \Internet Explorer \MenuExt \My Extension]
(Default) = “C:\MyExtension.html”
Contexts = 34

The (Default)-value specifies what command to execute when the extension is activated. The command must be implemented via a HTML-file, and if one don’t like having the HTML-file placed in the root of the C-Drive, then one can just move it to another place like C:\Windows\Web.
The Contexts-value specifies in what context the extension should be shown, and is a bit mask consisting of the logical OR of the following values:

  • Default = 0x1
  • Images = 0x2
  • Controls = 0x4
  • Tables = 0x8
  • Text selection = 0x10
  • Anchor/Link = 0x20
  1. Add these settings to the registry:

    [HKEY_CURRENT_USER \Software \Microsoft \Internet Explorer \MenuExt \Google Cache]
    (Default) = “C:\GoogleCache.html”
    Contexts = 32

  2. Create a text-file named C:\GoogleCache.html with the following contents:

    <SCRIPT LANGUAGE=”JavaScript”>
    var aDestination = “http://www.google.com/search?q=cache:”
    var aWindow = window.external.menuArguments;
    var aDocument = aWindow.document;
    var anEvent = aDocument.parentWindow.event;
    var aLink = anEvent.srcElement;
    aWindow.open(aDestination + aLink);
    </SCRIPT>

Add option to submit text-selection to a search-engine/dictionary
  1. Add these settings to the registry:

    [HKEY_CURRENT_USER \Software \Microsoft \Internet Explorer \MenuExt \Google Search]
    (Default) = “C:\GoogleSearch.html”
    Contexts = 16

  2. Create a text-file named C:\GoogleSearch.html with the following contents:

    <SCRIPT LANGUAGE=”JavaScript”>
    var aDestination = “http://www.google.dk/search?q=”
    var aWindow = window.external.menuArguments;
    var aDocument = aWindow.document;
    var aText = aDocument.selection.createRange().text;
    aWindow.open(aDestination + aText);
    </SCRIPT>

Add option to submit a page for translation
  1. Add these settings to the registry:

    [HKEY_CURRENT_USER \Software \Microsoft \Internet Explorer \MenuExt \Google Translate]
    (Default) = “C:\GoogleTranslate.html”
    Contexts = 1

  2. Create a text-file named C:\GoogleTranslate.html with the following contents:

    <SCRIPT LANGUAGE=”JavaScript”>
    var aDestination = “http://translate.google.com/translate?hl=en&u=”
    var aWindow = window.external.menuArguments;
    aWindow.open(aDestination + external.menuArguments.document.URL);
    </SCRIPT>

More info MS KB177241
More info MSDN: About the Browser
More info MSDN: Browser Extensions
More info MSDN: menuArguments Property

Credits Laurent Girod