# Add new option in IE's Right Click

Right Click Editor for Internet Explorer allows user to add new right click entries in Internet Explorer.

Add new right click entries in IE :-

To add new right click option in Internet Explorer click Add New Right Click Item as shown in the above screen shot.

User will be presented with above dialog. Write Name that appears in the right click of Internet Explorer in the Name text box. Browse for path of HTML file(*.html, *.htm) that contains javascript to perform some action using Browse button. Contexts are value indicating where you want your new right option to appear. You should get information regarding each context when you hover over them. You will find list of contexts and their use below.

Context | Description
Default | This is the context menu that will be used when none of the other contexts are in use. You would use this context typically when your add-on needs access to the entire Web page. For example, if you wanted to export the page to another application, extract all the images, or count the number of links on the page, you'd include the default context.
Images | This is the context menu that will be used when the user right-clicks an image. This menu typically has elements that enable you to save or edit the image. You may want to add a menu item to edit using a specific application or to send via another means (perhaps via instant messenger).
Controls | Used for the context menu for form controls. Typically this includes options for editing the text in these controls, but you may provide menu items to auto-populate the fields.
Tables | Used for the context menu for tables and table cells. This is arguably the least-frequently used value included in the Contexts item. Typically, it is used only for pages that enable the user to edit the page, enabling the addition of new rows and columns to a table.
Text selection | This identifies the context menu that is applied when text is selected in the browser. This can be a powerful tool when used in add-ons. You could pass the selection on to another page or application, or extract the source of just the selection rather than the entire page.
Anchor | Used for the context menu applied when the user right-clicks an anchor tag. Typically, this menu is used to enable the user to open the link in another window or tab. An add-on may enable opening in another application.

The code for the SearchScript.htm file is as follows.

<script language="JavaScript">

var parentwin = external.menuArguments;

var doc = parentwin.document;

var sel = doc.selection;

var rng = sel.createRange();

var str = new String(rng.text);

if(0 < str.length)

{

window.open("http://www.google.com/search?ie=utf-8&q=" + str, "_blank");

}

</script>

Within the script you execute, you can access the parent window by accessing the external.menuArguments property. The code uses this to drill down into the document object to identify the selected text. It then uses this selected text as the query on Google Search. You can use the same code to search other search engines that provide a simple URL-style query.

Restart Internet Explorer and select some text on a Web page. Right-click to see the new item on the context menu.