Browser keywords: using the address bar as a command line

[2011-01-07] browser, firefox, hack, computers, chrome
(Ad, please don’t block)
Keywords are commands you can enter in the browser address bar to quickly go to a website and perform, say, a search.

Examples

I’ve created the following keywords on my Firefox:
  • “gg foo” googles for “foo”
  • “we foo” searches Wikipedia for “foo”
  • “dict panache” looks up “panache” in an online dictionary
  • “imdb inception” looks up “inception” in IMDB.

How it works

Keywords work as follows. Given the keyword command
    we foo
This command goes to the URL
    http://en.wikipedia.org/w/wiki.phtml?search=foo
It does so, because there is a bookmark whose keyword is we and whose URL is
    http://en.wikipedia.org/w/wiki.phtml?search=%s
Henceforth, typing the keyword looks for this bookmark and replaces %s with the argument after we.

Tips

  • Keywords in Google Chrome: “Preferences → Basics → Search → Manage Search Engines...”
  • Keywords in Firefox: Go to the properties of a bookmark and set a value for “Keyword”.
  • Keyboard shortcuts that work in most browsers:
    • Ctrl-T (Mac: Cmd-T) opens a new tab.
    • Ctrl-L (Mac: Cmd-L) gets you to the address bar.

Details

  • Lifehacker explains the basics of keywords.
  • Mozilla describes the “add a keyword for this search” feature.