Skip to Main Content
Amazon Hacks
book

Amazon Hacks

by Paul Bausch
August 2003
Intermediate to advanced content levelIntermediate to advanced
304 pages
7h 33m
English
O'Reilly Media, Inc.
Content preview from Amazon Hacks

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

From ChatGPT to HackGPT: Meeting the Cybersecurity Threat of Generative AI

From ChatGPT to HackGPT: Meeting the Cybersecurity Threat of Generative AI

Karen Renaud, Merrill Warkentin, George Westerman
Incident Metrics in SRE

Incident Metrics in SRE

Stepan Davidovic

Publisher Resources

ISBN: 0596005423Supplemental ContentCatalog PageErrata