[IE tip] Add "Copy Image Location" menu item

Cross posting this from my blog...

As I may have mentioned earlier, I'm making it a point to use IE 7 as my primary browser, at least during the beta test period, so that I can report any issues that I find.

Since I've been using Firefox for such a long time, there was one little thing that was bugging me - IE does not include a context-menu item to quickly copy the location/URL of an image on a webpage. This is something I tend to use quite often (to post links to images in emails, IM messages, on forum threads etc.), and the multi-step process of selecting Properties, highlighting the image location and then copying it just wasn't cutting it.

So I posted a wish/suggestion on the beta newsgroups asking for such a context-menu item. Eric Lawrence from the IE team responded to my post and said it's possible to add something like this quite trivially using the MenuExt registry key. I looked up the MenuExt registry reference on MSDN, understood how it works, and wrote this quick little JavaScript blurb that adds a "Copy Image Location" item to the IE context menu. Note that this is not IE7-specific and will work on IE6 as well.

Here's how you do it. Copy the following piece of code into Notepad and save it as a HTML file to any location (I'll use C:\Windows\copyimageurl.html for this example):

<script language="JavaScript">
var image = external.menuArguments.event.srcElement;
Then you need to create a registry key to point to this file:

1. Start>Run>regedit
2. Navigate to HKCU\Software\Microsoft\Internet Explorer\MenuExt
3. Create a new sub-key and call it "Copy Image Location" (this is the text that appears in the menu)
4. Set the "(Default)" string value to the location of the html file we created - C:\Windows\copyimageurl.html in this example.
5. In the same key, create a new DWORD value called "Contexts" and give it a value of 2 (this means that the menu item appears only when you right click an image)

That's it. Close any existing browser windows and when you open them back up, you should notice a new context-menu item that copies the image location to the clipboard.

Ah, that made life much easier. :)


(value not set)
Staff member
Political User
Im still waiting for a "Open link in Firefox" option :p

Ill still do this one anyway...
Hehe, I don't have Firefox installed right now. I'll download it and try to write something. Shouldn't be too difficult. :)
Last edited:
Ok, here you go. Same basic concept.
Toss the code into an html file, create a new sub-key under MenuExt ("Open Link in Firefox"), and set the Default value to the path of the html file. This time you'll want to give the Contexts DWORD a hex value of 20 (that's decimal 32), so that it only appears when you right-click hyperlinks.

<script language="JavaScript"> 
var foo = new ActiveXObject("WScript.Shell"); 
foo.Run("Firefox " + external.menuArguments.event.srcElement); 
You know, this is actually fun to play with! Here are two more I thought of. Very simple, but quite handy - highlight text and search for it on Google or Dictionary.com.
I call the menu items "Google It!" and "Define It!" :D

Google It!
<script language="JavaScript">
open('http://dictionary.reference.com/search?q=' + external.menuArguments.document.selection.createRange().text);
Define It!
<script language="JavaScript">
open('http://www.google.com/search?q=' + external.menuArguments.document.selection.createRange().text);
You can add Wikipedia, Yahoo, or whatever else you want using the same syntax...even a mapping service to search for street addresses. This time, set the Contexts DWORD value to hex 10 (that's decimal 16) so that the items appear only when you right-click highlighted text.
zeke_mo said:
I dont see that in my reg, is that a vista only feature?
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt
If you don't see the MenuExt key, just create one. It probably gets created by the first menu extension that's added (mine was the "Export to Microsoft Excel" one created during the Office 2003 install). It's definitely not a Vista-specific feature though. :)


OSNN One Post Wonder
Nice work.

Is there any way to create a context menu in IE that would send an image to an external program?

For example, I right click on an image and select "Send to Photoshop"?


Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
What a long strange trip it's been. =)

Forum statistics

Latest member