Stupid Firefox Tricks, Part I - page 2
Simple Bookmarklets: The Power of the Command Line in your Browser
The next step is to give it a keyword -- a unique name for that bookmark. Firefox unfortunately doesn't let you set keywords in the Bookmark this page dialog, though extensions like Openbook can give you a smarter bookmarking dialog. Save the bookmark then call up Bookmarks->Organize Bookmarks. Find the bookmark you just set, and click on the More button. Pick a nice short keyword that's easy to type, like "yahoo".
Setting a keyword gives the bookmark a useful property: if you type that keyword in the URLbar and hit return, Firefox will go straight to that bookmark. If you're a commandline user, that's already a win -- it's easier for some of us to remember a word like "yahoo" than to navigate a bunch of hierarchical bookmarks menus.
Now comes the important part. Replace the term you searched for, banana, with %s in the Location field (figure 1). Go ahead and dismiss the dialog -- you're done with it.
The magic "%s" tells Firefox, "Replace me with a string supplied by the user." You'll supply it by typing it in the URLbar. Try it now. Go to the URLbar -- Control-L is a handy shortcut that takes you there and highlights whatever's there so you can replace it, but doesn't overwrite your X selection in case you want to paste. Type yahoo bookmarklets and hit return. Firefox should take you straight to the Yahoo's search results page for "bookmarklets": http://search.yahoo.com/search?p=bookmarklets. Neat! It even works for multiple search terms and quoted strings.
You can use the Keywords trick to set up bookmarklets for
all sorts of different searches, like Google Images at
http://images.google.com/images?q=%s, Google Maps at
Wikipedia at http://en.wikipedia.org/w/wiki.phtml?search=%s.
Getting the Wikipedia search URL is a little tricky, since their search
redirects you to a wiki page, not a search results page. Sometimes you
have to poke through View->Page Source, or ask around to see
if anyone else has already figured out a query.
- Skip Ahead
- 1. Simple Bookmarklets: The Power of the Command Line in your Browser
- 2. Simple Bookmarklets: The Power of the Command Line in your Browser
- 3. Simple Bookmarklets: The Power of the Command Line in your Browser
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: GNOME 3.12 and New Betas for Ubuntu 14.04 and OpenMandriva Lx 2014.0
- 2Linux Top 3: Linus Lashes out, Linux 3.14 Gets PIE and Ubuntu One is Done.
- 3Linux Top 3: Ubuntu 14.04, Debian Gives Squeeze More Life and Red Hat Goes Atomic
- 4Linux Top 3: CoreOS, Oracle Enterprise Linux 7 and Ubuntu 14.10
- 5Linux Top 3: Debian Dumps SPARC, Ubuntu Takes Over Linux 3.13 and the Core Infrastructure Initiative