René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

Extending Internet Explorer's context menu

In order to extend IE's context menu, one needs to make an entry in the registry:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Menu description
If Menu description contains an ampersand (&), the character following the ampersand will be used as a shortcut key to access the menu.
This registry key's default value must be set to the URL to be fetched. As the following script demonstrates, the URL can also be a local file.
The following script copies the Title and the URL of a web page to the clipboard. If it is stored on the hard disk, use the path to the filename in the registry.
<form name=a><textarea name=a1></textarea>
  <SCRIPT language=javascript defer>

    var oExtArgs = external.menuArguments;
    var sTitle   = oExtArgs.document.title;

    if (sTitle=='') sTitle='No Title';

    var oTarget=document.a.a1;

    oTarget.value=sTitle+': \r\n'+oExtArgs.location.href+'\r\n';

    oTarget.select();
    var oTextRange=oTarget.createTextRange();
    oTextRange.execCommand('copy');
    if("do alert")(oExtArgs.alert(oTarget.value+'\r\nCopied to Clipboard'));
  </SCRIPT>
</form>