Hack 92: Quickly Search Within Specific Websites from the Address Bar – How to Master the Web
Platform Web (Firefox/Chrome)
Most web browsers have a built-in search box next to or integrated with the address bar for quick access to search engines. By default, this search box is a front door to major engines like Google or Bing. However, sometimes you know what site you want to search within, like Wikipedia or Amazon, but you want to skip the part where you go to Google or Bing results first, and instead just search the site directly using your browser’s built-in search feature. Keyword searches are customizable, keyword-based searches that let you do just that: execute a search from your Firefox or Chrome address bar. Using these special searches significantly speeds up queries on your nondefault searches at sites such as IMDB.com or YouTube.
Keyword searches work like this:
1. Enter a short keyword in the address bar that indicates what site you want to search.
2. Press the spacebar.
3. Type your search query.
For example, if you want to search Wikipedia to read up on Firefly, type w firefly into your browser’s address bar and press Enter. If you set up a keyword search that associated ‘w’ with Wikipedia, your browser automatically looks up ‘firefly’ using Wikipedia’s search engine.
You can set up the same quick-access searches for your favorite online dictionary, thesaurus, image search, encyclopedia, productivity website, and so on. It may not sound like a lot, but if you regularly search sites like Urban Dictionary.com or Yelp in addition to, say, Google, keyword searches can save you considerable time. Here’s how to set up and use keyword searches in Firefox and Chrome.
To create a keyword search for Wikipedia using Firefox:
1. Browse to Wikipedia (www.wikipedia.org).
2. Right-click Wikipedia’s search box, and select Add a Keyword for this Search, as shown in Figure 10-3.
3. Enter a keyword for this search — something short but memorable, like w for Wikipedia, as shown in Figure 10-4. Click Save.
Figure 10-3: Right-click in the search box and select Add A Keyword for this Search.
Figure 10-4: Assign a title and, most important, a keyword to your Quick Search.
Now that you set it up, use it to search Wikipedia for the term Lifehacker:
1. From any page, press Ctrl+L (Cmd+L on Mac) to move your cursor to the address bar, or just do it manually.
2. Type w lifehacker into the address bar.
3. Press Enter.
Firefox searches Wikipedia as though you navigated to the Wikipedia home page and entered lifehacker directly in Wikipedia’s search box — you just cut out the middleman.
You can use the same technique to add any number of quick keyword searches to Firefox.
Chrome’s address bar doubles as a search input so there is no separate box; it has built-in search engines for Google, Yahoo!, and Bing, and you can set any of those as your default search engine. But Chrome also has a clever trick up its sleeve: When you visit websites that contain search boxes, Chrome can automatically detect and save new search engines, and then create keyword shortcuts for quickly searching these sites in a few keystrokes.
For example, if you open http://amazon.com in Chrome, it detects Amazon’s search box and automatically adds Amazon to your list of available search engines. Now, the next time you want to search Amazon, try this out:
1. From any page, press Ctrl+L (Cmd+L on Mac) to move your cursor to the address bar.
2. Type amazon.com lifehacker. Chrome recognizes “amazon.com” as a keyword search and, after you enter a space followed by a term, it displays the option to “Search amazon.com,” as shown in Figure 10-5 to indicate that you’re performing a keyword search.
3. Press Enter. Chrome searches Amazon for this book, and you didn’t need to navigate to Amazon first or remember any arcane shortcuts. By default the keyword for new search engines is the site’s domain — in this case, Amazon.com.
Figure 10-5: Amazon.com keyword search in Chrome.
TIP To see all the search engines Chrome added, click the Wrench button, select Preferences, and then click the Manage Search Engines button.
If you press Ctrl+L and type only am, Chrome can guess that you’re going to type amazon.com and autocompletes the rest of the text for you. You could then visit the site by pressing Enter, but if you want to execute the keyword search for that site, you can press Tab, enter your query, and then press Enter.
NOTE If you prefer to set up even shorter keyword shortcuts in Chrome (like with Firefox), click the Wrench button, select Preferences, and then click Manage Search Engines. From this dialog you can click any of your search engines and change the keyword to something shorter — like “a” instead of “amazon.com.” You can also add new search engines from this dialog.
Now you can go through and assign keywords to each search engine you use on a regular basis, or you can download the Lifehacker Bookmark set discussed in the next section.
Download the Bookmark Set
A list of popular keyword searches is available for download on Lifehacker.com for quick installation on Firefox. (As of this writing Chrome doesn’t enable you to import keyword searches.) The file includes fifteen popular keywords.
Here’s how to install them:
1. Using Firefox, go to the Quick Search bookmarks file at http://lifehackerbook.com/ch9/quicksearch.html.
2. Choose File ⇒ Save As and save the file somewhere on your computer.
3. Choose Bookmarks ⇒ Show All Bookmarks.
4. From the Bookmarks Manager, click the Import and Backup button and choose Import HTML, as shown in Figure 10-6. Select From an HTML file, and then browse to and open the quicksearch.html file you just saved.
Figure 10-6: Import the Quick Search bookmarks from Firefox’s Bookmarks Library.
Now you have a Lifehacker Quick Searches folder in your Bookmarks, which includes all sorts of keyword searches, described in the following section.
Lifehacker Quick Searches
What follows is the full list of Quick Searches included in the Lifehacker file:
Finds an acronym for your word
amazon <product name>
Looks up an item on Amazon.com
Finds the definition of your word
Finds the item you want on eBay
flickr <search term>
Finds all the tags, titles, and descriptions of images at Flickr that match your search term
Produces a Google map of a street address or location
image <search term>
Finds images that fit your search term
lh <search term>
Searches the Lifehacker site for information
Finds synonyms for your word
twitter <search term>
Finds recent tweets which contain your search terms
Defines your slang expression
Looks up your search item in the collaboratively- edited encyclopedia Wikipedia
Yahoo! Creative Commons
Finds Creative Commons–licensed items available for reuse
Finds a local business listing
youtube <search term>
Looks for videos posted to YouTube that fit your search
Customize your Quick Searches using the Bookmarks manager (choose Bookmarks ⇒ Organize Bookmarks). Browse to the Lifehacker Quick Searches subfolder and click any bookmark to change a keyword shortcut or edit a URL.