Search Amazon from Any Web Page in IE
Searching Amazon from any web page can be as simple as highlighting and clicking with an Internet Explorer context menu.
If searching Amazon from your address bar [Hack #10] isn’t your style, you may find it helps to have context. Imagine this: you’re reading an article on your favorite news web site about the latest tech trend: overclocking. It sounds like something you’d like to try, and you wonder if there are any books on the subject. You highlight the word, right-click, choose “Search Amazon” from the menu, and a new window opens with your answer. You can make this happen with a little JavaScript and a new registry entry.
The Code
First, the JavaScript. This bit of code will open a new browser window and plug the highlighted text into a URL. This code needs to be in a file somewhere on your computer where it can be accessed from the browser, and won’t be deleted in a fit of spring cleaning. You could even create a new folder for it, c:\scripts\. If you have another location in mind, be sure to change any references to c:\scripts\ in the following code.
Create a file called AmazonSearch.html and add this code:
<script language="JavaScript">
var searchURL = new String("http://www.amazon.com/exec/obidos/[RETURN]
external-search/mode=blended&keyword=");
var w = window.external.menuArguments;
var d = w.document;
var s = d.selection;
var r = s.createRange( );
var term = new String(r.text);
window.open(searchURL + term);
</script>Save it in the