# Extending the Internet Explorer context menu

Raymond

In a comment
,

Darrell Norton
for a “View in Mozilla” option for Internet Explorer.

Internet Explorer’s

has been in MSDN for years.
Let me show you how you can create this extension yourself.

First, create the following registry key:

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\View in Mozilla]
@=REG_SZ:"C:\some\path\to\ViewInMozilla.htm"
Contexts=REG_DWORD:1


Of course, you need to change C:\some\path\to to an actual path.

How did I know to do this?
Because steps 1, 2 and 3 in the “Implementation Steps” section tell
me (1) what key to create, (2) what to set the default value to, and
(3) what to set Contexts to.
I chose a Context value of 1, which means “Default”.

Okay, now to write the script ViewInMozilla.htm.
Well, the documentation says that I can access context
from the

property of the

external
object.

<SCRIPT>
</SCRIPT>


Okay, let’s run this puppy. Launch IE, right-click on a blank
space in the web page, select “View in Mozilla”, and you get…

    [object]


Woo-hoo! This is a major accomplishment: Something happened at all.
Doing things in small steps makes it easy to identify where a problem is.
and then it didn’t work, we wouldn’t have
known whether it was due to a bug in the script, a bad registration, a bad
filename…

Now that I have the menu arguments, I can use that
applies to. Let’s try this:

<SCRIPT>
</SCRIPT>


Woo-hoo, now it gives me the URL. Almost there. All that’s
left to do is to run a program with that URL as the command line
parameter.

<SCRIPT>
var shell = new ActiveXObject("WScript.Shell");
shell.run("mozilla \"" + external.menuArguments.document.URL + "\"");
</SCRIPT>


Mission accomplished.

Now you too can create Internet Explorer context menu extensions.

In fact, go ahead and do it, since Darrell asked for it:
Create an Internet Explorer
context menu extension that operates on anchors and opens the