Monday, December 13, 2010

Chrome's Omni-Search

I've mentioned this feature before, but thought I'd give it a bit more attention. Google Chrome is very smart, and the omnibar is very powerful.

For example, if you go to a site like dictionary.com and do a search (such as "Chrome"), you're taken to a page with a URL along the lines of http://dictionary.reference.com/browse/Chrome (notice how the search term is actually part of the URL).  But part of the amazing thing with Chrome is once you've done a search once, Chrome will usually automatically figure out how the search page URLs are formed. Then all you have to do is type something like "dictionary.com{tab}blog{enter}" and you'll be immediately taken to the search results page. And it does this automatically and completely in the background on almost any site! It'll even tell you when you can do this so when you start typing "dictionary.com" in the omnibar off to the right you'll see a message "Press {Tab} to search Dictionary.com".

And while it will figure this out automatically on most sites, on some it doesn't quite work for various reasons. Also, understanding what's going on in the background allows for a couple other tricks with this feature.

So... when you do the search the first time Chrome will automatically detect the URL of the new page. If it contains the data from the form (search box) you filled on on the previous page it adds an entry in its internal list of Search Engines with the new page URL and replaces the search term with a special "%s"... a variable meaning "whatever I searched for".
In Chrome you can view (and add & edit) the sites Chrome knows how to do searches on for by going to Wrench -> Options -> Basics. And in the "Default search" area, click the "Manage" button. Under the "Other search engines" heading you'll see all the other sites Chrome has figured out how to search for you.

This is also where you can add these couple tricks...
Because Google Maps uses AJAX to perform searches the URL does not directly get changed. However, Google has made it so you can still perform a search on Maps using a URL simply with...
http://maps.google.com/?q=%s
So to be able to search Maps directly from your omnibar simply go to that Search Engines manager, click Add and add the URL as a new search engine.