[sponsored links]

Free JavaScript Utilities
By John Fitzgibbon
Last updated: Thursday, March 30, 2006, 03:51 PM PST



Introduction
Here are some small JavaScript utilities I've written. Feel free to download any you think you might find useful. These scripts are designed to extend the functionality of Internet Explorer by adding new options to the context, (right-click), menus.

search.htm

When invoked from a context menu in Internet Explorer, this document opens a new window to perform a Google search for a highlighted text selection, or for a URL.

When opened without a browser context, instructions on how to edit the registry to add a context menu item are displayed.

By default, the JavaScript code in this document uses Google to perform the search. This can be modified to use any of the more popular search engines. To do this, edit this file and modify the search strings at the beginning of the JavaScript code.

newsclip.htm

When invoked from a context menu in Internet Explorer, this document copies a HTML snippet to the clipboard. The snippet links the highlighted text to the current URL. Typically, I use it for copying news headlines to my website.

If the word "By" is in the text, it is assumed that the author's name follows the "By" and the HTML highlighting takes this into account.

secure.htm

When invoked from a context menu in Internet Explorer, this document copies the top level domain of the current URL to the clipboard. All but the last two components of the name are replaced by an asterisk. For example:

http://shopping.yahoo.com/shopping/horribly_dangerous_shopping_script.asp

would be reduced to:

http://*.yahoo.com

This clipped text is useful for quickly adding a top level domain to Internet Explorer's list of secure sites. I find it useful for shopping sites that use dangerous scripting that I have disabled in the "Internet Zone", but allowed in the "Secure Zone". I invoke the script, paste the top level domain into the "Secure Zone" list, do my shopping, then, (optionally), remove the site from the Secure Zone again.