Monday, April 11, 2011

Getting Lucky with the AwesomeBar

I used to use the Google toolbar in Firefox, back in the day. It had a nice feature that allowed you to type a search into the box and press a modifier key (may CTRL?) when hitting return to get an automatic "I'm feeling lucky" Google search. The benefit to this was that if you knew for sure what you were entering was sufficient to get the page you wanted as the first result, you could skip Google all together and go straight to the site. I loved this feature for things like Wikipedia.

You can (almost) always do a Wikipedia search from Google simply by prefixing your search with "wiki." For example: "wiki bon jovi" in a Google search box shows Bon Jovi's Wikipedia page as the first result. Combining this with the shortcut that I mentioned earlier and you're got yourself a Wikipedia search box on your web browser for zero screen real estate. This holds true for other things as well–"foxnews tech" would take you straight to the FoxNews Science & Technology page, for example. It's been a long time since I've had the Google toolbar (Google stopped developing it years ago) and I have missed this feature. Today I just enter my search into the Firefox search box and bring up the Google results page.

There's a feature of modern browsers that I, as an old-school purist, have never liked. It is the feature that allows you to type a non-URL into the address bar of modern browsers and have a search done by default. I used to turn this feature off because, as a purist I felt that the address bar was for URLs. If I typed an invalid URL into the address bar, I expected to see a 404 error. Overloading it with search functionality (while it made it easier for computer novices to get around the web) didn't make sense to me–the address bar was for addresses, the search bar was for searches. Google, with their Chrome browser, has abandoned the idea of a separate address bar and search bar. Firefox has also adopted this model as well but still sports a search box by default, probably to make people like me feel more comfortable. Also, as they allowed the user to turn off the "AwesomeBar" functionality (as they call it), a search box would make a lot of sense.

UPDATE: Upon further research, I discovered that there are some things that you can only search for from the search box (or going to the Google homepage) with Firefox. This is not the case with Chrome's "Omnibox" (their version of the "AwesomeBar"), it allows you to do this type of search within it. I'm referring to any search which contains a colon (:). For example, if you type (in a Google search box) "define:NAS" you will be taken to the Google definitions page for "NAS." Also, the "site:" tag that's used to search a particular domain will not work. This is because Firefox considers anything with a colon to be a transport protocol specifier. Again, this is why I always thought that address bars and search bars should be separate. I'm not sure what algorithm Google uses to overcome this, but it can't be simple.

Well, today I decided that I wanted my "I'm feeling lucky" shortcut back, and I set out to find a way to add the functionality back into the search box. The Firefox search box is not nearly as powerful as the one that the Google Toolbar provided, but I had hoped that there was a modifier key (shift, control, alt, etc) that would do an "I'm feeling lucky" search. Alas, this was not the case. I did, however, stumble across a way to achieve the result I was looking for. Sadly, it involves the AwesomeBar. *sigh*

OK, so here's the deal. The AwesomeBar does a search by default when you enter a non-URL. The thing is, you can modify the parameters of the search by changing some things "under the hood" of Firefox. Using this, we can instruct Google to return not the results page, but rather the first result, exactly what we want! While I still have issues (as a purist) with overloading the address bar like this, I can live with it if it means getting my "I'm feeling lucky search box back.

Here's a page that describes how to achieve this will all browsers:

http://www.google.com/support/forum/p/Chrome/thread?tid=25cf5ea2bc5a2744&hl=en


It erroneously states that Firefox provides this by default, but this did not appear to be the case with mine, so I changed the "keyword.URL" setting (in about:config) to the following:
http://www.google.com/search?sourceid=navclient&hl=en&gfns=1&q=

UPDATE (20 Apr 2011): I later discovered that it worked on my laptop, I don't know why the configurations were different.


The key seems to be the "gfns=1" setting. The previous setting for my installation was:
http://www.google.com/search?sourceid=navclient&hl=en&q=

So now when I type "wiki bon jovi" into my address bar (oops, I mean AwesomeBar), I get my Bon Jovi Wikipedia page. Whew. And... if I hold down the "Alt" key while pressing return, my "lucky" page opens in a new tab–the same functionality as with URLs.

I'm posting this as a blog entry so that it will forever be findable on the World-Wide-Web, for when I re-install my system, forget how to set this up again and can't find the aforementioned page. That and in the event that anyone else out there is as lazy (or efficient–as I like to claim) as I am. :-)
-Tom
UPDATE (12 Apr 2011): Here's a potentially handy tip: "man {command}" for Linux man pages or "solaris man {command}" for Solaris man pages. Ex: "solaris man ls"
UPDATE (8 Aug 2013): Firefox hasn't been honoring the setting in the latest versions. I had to create a custom search provider using Ready2Search. I called it "I'm Feeling Lucky." Seemed appropriate.

No comments:

Post a Comment