Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 4 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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