Is it possible to define shortcuts in Firefox to do a Google search restricted to a particular site?

Background: in the Opera web browser I can define a shortcut, say "su", to do a Google search restricted to a particular site, e.g. superuser.com. This shortcut can be used from the address bar.


su firewall

will do the same as opening www.google.com and typing:

site:superuser.com firewall

The definition for this is:


where "%s" represent the search string - "firewall" in the example.


Yes, and the exact same syntax is used in the Firefox bookmarks. You may want to do a google search that you want with some replacement for the text you want to replace (I use XYZZY for this, it's easy to spot). Then replace XYZZY with %s, and add a "keyword" to the bookmark (it's in the "more options" section of the bookmark manager). Then you can type the keyword and whatever you put after the keyword will replace %s in the URL.

See this reference for keywords in Firefox. I tend to leave the trailing colon out of my keywords, they're easier to type. Lifehacker also had a decent article on it which may be more recent.

| improve this answer | |
  • Ah yes. I have tried it now and it works. Thanks! – Peter Mortensen Jul 29 '09 at 17:14
  • It even works with delicious.com and the Delicious Toolbar (addons.mozilla.org/en-US/firefox/addon/3615) if you're using that. Right-click in the search field and choose "Add a keyword for this search in Delicious", and you can use the shortcut everywhere you have the toolbar installed. I suppose you also can create the link manually on Delicious and tag it with shortcut:foo (where "foo" is the shortcut itself). – sunny256 Jul 29 '09 at 17:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.