Blog

6 September 2005

Google Toolbar Custom Searches

I logged in to Gmail just now and saw a new feature on the Settings page.

New! Get the Google Toolbar, now with Gmail search, and search your mail quicker than ever.

The installer download on that page – named GmailToolbarInstaller.exe – simply added a Gmail button to my Google Toolbar that allows me to search Gmail (or takes me to my Gmail inbox if I don’t enter any search terms).

I figured that since the install was only 15 KB, it must have been a pretty simple upgrade. On the surface, the only changes were that a Gmail icon was now in the toolbar and in the "Search the Web" drop down next to the search box. Also, the "Search" tab of the Google Toolbar "Options" window had a new section called "Add Custom Search Buttons to your Toolbar" that listed the Gmail icon with a checkbox next to it. Hunting around in Registry Editor, I found this new key:

HKEY_CURRENT_USER\Software\Google\CustomSearch\Gmail

The term "CustomSearch" was intriguing, so I decided to try and add my own custom searches. What I found was that you can add you own custom search buttons to the Google Toolbar by making a few simple changes to your registry...

Caution: Editing your registry incorrectly can cause irreparable system damage. Fiddle with it at your own risk!

Here’s an example of an exported registry key that adds a Yahoo! Search button:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Google\CustomSearch\Yahoo]
"Site"="http://search.yahoo.com/"
"Tip"="Yahoo! Search"
"Title"="Yahoo! Search"
"Url"="http://search.yahoo.com/search?p={query}"

Likewise, here’s one that will add an MSN Search button:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Google\CustomSearch\MSN]
"Url"="http://search.msn.com/results.aspx?q={query}"
"Site"="http://search.msn.com/"
"Tip"="MSN Search"
"Title"="MSN Search"

Basically, you can add a button for any site that uses a query string! For example, here’s one that will query Alexa for a website’s details when you enter a domain:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Google\CustomSearch\Alexa]
"Site"="http://www.alexa.com/"
"Tip"="Alexa"
"Title"="Alexa"
"Url"="http://www.alexa.com/data/details/?url={query}"

These buttons then appear in the drop down list of search buttons next to the search box:

Google Toolbar Custom Search Buttons

... or you can add them to your toolbar from the "Search" tab of the Google Toolbar "Options" window:

Google Toolbar Custom Search Options

Here are some sample registry files that automatically install the search buttons:

Simply right-click the links, download the files (selecting Save Target As...), change the extension to ".reg" and just double-click to install the custom search buttons. [Insert usual disclaimer about me not being held responsible for your actions here.]

At last – I only need to have one toolbar installed that will handle all my search needs!

Update: 16 September 2005
I’ve just discovered that these instructions work for both Internet Explorer and Firefox, although I don’t know where Firefox stores which custom search buttons it should display in the toolbar...

Update: 6 November 2005

Several people have asked me how to create hex encoded icons for use in these files, so here’s how it’s done:

  1. If it exists, download the “favicon.ico” file from the root of the website you’re creating – i.e. http://ruscoe.net/favicon.ico. (If the site doesn’t have its own icon, you can either create your own 16 x 16 ICO or GIF to use instead.)
  2. Open the icon file in a hex editor that allows you to “copy as hex string” – such as XVI32 by Christian Maas.
  3. Copy the hex code of the icon and paste it into the registry file with commas instead of spaces and slashes at the end of each line, as shown in the examples above.

Labels:


3 Comments

ygSome days I do wonder what generation you sheffieldites work in, yup ok the google search bar is a handy tool, but there's been third party IE tools out there for yonks which already do this automatically (http://www.maxthon.com is my fav) or if you use Firefox bingo available on install.

But well done anyway Tony nice little mod (which we all love) for a popular appy, for all you yesteryear users !!!!!

Ant, I know there are plently other 3rd party tools that do this but I just like using the Google Toolbar.

I guess it's partly because I trust Google more that some dodgy programmer who could have easily written a keylogger or spyware into his handy toolbar.

Of course, I'm not saying that all programmers are malicious, but you know what they're like... ;-)

(Just don't ask why I'm still using IE rather than Firefox... I simply can not answer that one!)

Tony, this is GREAT! I always wanted a Google Toolbar that searches AllTheWeb, my favorite search engine (less crap in there). Finally my dream came true!

Just one question: can you recommend a tool to create these hex encoded icons?