How Cool are Custom Keywords?
by Asa Dotzler, edited by Daniel WangMozilla Custom Keywords ROCK! Not just for making shorthand for bookmarks but also for searches and queries. Simple keywords allow you to type a short string in the Location Bar and load its corresponding Bookmark URL.
An example is my bookmark for http://www.mozilla.org
to which I've added the
keyword
. So, with that set, I can type m.o
in the Location Bar and it loads
http://www.mozilla.org. Using keywords combined with autocomplete in Mozilla and I seldom
type more than about three or four characters for all of the sites I regularly visit.m.o
To set a keyword you must first create a bookmark for the URL. Then you add the keyword to the bookmark. Open the Bookmark Manager (Ctrl+B), choose your bookmark, and then open the Bookmark Properties window (Ctrl+I, or from the context menu). In the window simply add a short string to the Keyword field. Now close that dialog and you can type the keyword in the Location Bar, hit enter, and Mozilla will load that URL.
But that's just the beginning. Custom keywords can be used to create shortcuts for your favorite search engines too (the 'this ROCKS!' part). Here's how it works.
I'll use Bugzilla Bug Report lookup as an example.
- Bookmark
https://bugzilla.mozilla.org/show_bug.cgi?id=%s
, where the%s
will be replaced by the bug number (query string) - Give the bookmark the keyword
bug
- Now typing
in the addressbar will load that bug.bug 12345
The keyword "bug" followed by a space and the bug number will load the URL
"https://bugzilla.mozilla.org/show_bug.cgi?id="
+ the bug number "12345".
Some other really cool examples:
http://www.google.com/search?q=%s
(I gave it the keyword "?")http://www.google.com/search?q=%s&btnI=I'm+Feeling+Lucky
(I gave it the keyword "g")http://search.dmoz.org/cgi-bin/search?search=%s
(I gave it the keyword "dmoz")http://www.dictionary.com/cgi-bin/dict.pl?term=%s
(I gave it the keyword "dict")http://lxr.mozilla.org/seamonkey/find?string=%s
(I gave it the keyword "lxrfile")http://lxr.mozilla.org/seamonkey/search?string=%s
(I gave it the keyword "lxrtext")
There are probably other great uses for this, just try a query at your favorite search engine and look at the URL it generates. If you can replace your search string in that URL with "%s" you can probably make this work. Throw in a little javascript and it's off to the races :)