Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

Example:

su firewall

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

site:superuser.com firewall

The definition for this is:

http://www.google.com/search?q=site:superuser.com+%s&sourceid=opera&num=%i&ie=utf-8&oe=utf-8

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

share|improve this question
up vote 5 down vote accepted

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.

share|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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .