Using keyword searches: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
(→‎External links: added my own page, warn about spam bombing on another)
(Use of %s vs. %S per bug: 270703)
Line 44: Line 44:
# In your bookmark&rsquo;s URL (the Location field), find and replace what you searched for with <tt>%s</tt> (If it does not appear, you cannot use a quicksearch here)
# In your bookmark&rsquo;s URL (the Location field), find and replace what you searched for with <tt>%s</tt> (If it does not appear, you cannot use a quicksearch here)
# Add a keyword
# Add a keyword
Difference between (small s) <tt>%s</tt> and (Capital S) <tt>%S</tt>
# (small s):  <tt>%s</tt> will have additional substitution replacements:  <tt>#</tt> by <tt>%23</tt>,  <tt>%</tt> by <tt>%25</tt>,  and <tt>/</tt>,  <tt>%2F</tt>,  <tt>@</tt> by <tt>%40</tt>.
# (Capital S):  <tt>%S</tt> will not have substitutions and allow use of  <tt>C++</tt> in a Google search,  allow use of  <tt>@</tt> in an email substitution, allow use of a fragment-id in a url substitution <tt>index.html#example2</tt>, and use of a directory as in <tt>code/example2.txt</tt>.


''Note: Mozilla Suite users can use the &ldquo;Bookmarks &rarr; File Bookmark...&rdquo; feature and edit bookmark&rsquo;s properties at the moment of its creation.''
''Note: Mozilla Suite users can use the &ldquo;Bookmarks &rarr; File Bookmark...&rdquo; feature and edit bookmark&rsquo;s properties at the moment of its creation.''
"Note: Firefox users with [https://addons.mozilla.org/en-US/firefox/addon/42 Open Book] extension can create a bookmark and add keyword property at the same time."


==See also==
==See also==
Line 58: Line 64:
* [http://www.mozilla.org/products/firefox/smart-keywords Smart Keywords]
* [http://www.mozilla.org/products/firefox/smart-keywords Smart Keywords]
* [http://johnbokma.com/firefox/keymarks-explained.html Firefox smart keywords explained] includes screenshots
* [http://johnbokma.com/firefox/keymarks-explained.html Firefox smart keywords explained] includes screenshots
* [http://www.wormus.com/leakytap/Internet/CustomKeywords/ CustomKeywords] with other links, as well (under wiki spam attacks, last good version was [http://www.wormus.com/leakytap/internet/customkeywords?rev=1180626278  2007-05-31])
* [http://www.wormus.com/leakytap/Internet/CustomKeywords/ CustomKeywords] with other links, as well  
* [http://www.pitt.edu/~crp11/firefox/quicksearches/ Quicksearches -- Samples and Instructions] by Chris Poverk, creator of the related SmartSearch extension
* [http://www.pitt.edu/~crp11/firefox/quicksearches/ Quicksearches -- Samples and Instructions] by Chris Poverk, creator of the related SmartSearch extension
* [http://quicksilver.blacktree.com/ Quicksilver] provides access to Mozilla suite/Firefox keyword searches globally (from within any application)--for Mac OS X
* [http://quicksilver.blacktree.com/ Quicksilver] provides access to Mozilla suite/Firefox keyword searches globally (from within any application)--for Mac OS X
* [http://www.mvps.org/dmcritchie/firefox/kws.htm Firefox Keyword Shortcuts] by David McRitchie, includes usage tips
* [http://www.mvps.org/dmcritchie/firefox/kws.htm Firefox Keyword Shortcuts] by David McRitchie, includes usage tips

Revision as of 22:28, 17 November 2007

This article applies to Firefox and Mozilla Suite.

In Firefox and Mozilla Suite you can specify keywords for bookmarks by filling in the “Keyword” field in the bookmark’s Properties. When you type the keyword into the Location Bar and hit [Enter], the keyword will be replaced with the bookmarked URL. For example, bookmarking http://google.com/, giving it a keyword of “g”, and typing “g” into the Location Bar will take you to Google.

What makes keywords very powerful is that if you add a “%s” at some place in your bookmark’s URL, it will be replaced by the words you type in after the keyword. (These are sometimes called “Quicksearches”.) For example, if we were to modify the bookmark mentioned above so that it pointed to “http://google.com/?q=%s”, we can type “g mozilla” into the Location Bar to arrive at “http://google.com/search?q=mozilla”.

Default searches

By default, Mozilla Firefox comes with several bookmarks with keywords defined. They’re located in the “Quick Searches” folder in the default bookmarks.

Bookmark Name Keyword Bookmark URL
Google Quicksearch google http://www.google.com/search?q=%s
Dictionary.com Quicksearch dict http://dictionary.reference.com/search?q=%s
Stock Symbol Quicksearch quote http://www.google.com/search?q=stocks:%s
Wikipedia Quicksearch wp http://en.wikipedia.org/wiki/Special:Search?search=%s
Urban Dictionary slang http://www.urbandictionary.com/define.php?term=%s

Creating bookmarks with keywords

In Mozilla Firefox, you can simply right-click in a search field on a web page and choose “Add a Keyword for this Search.” This will pop up a dialog for you to add a bookmark name and keyword.

You can also create it manually:

  1. Do a search on the site you want to add a quicksearch to.
  2. Bookmark the page you are brought to (the results page).
  3. Open the Properties dialog for your new bookmark.
  4. In your bookmark’s URL (the Location field), find and replace what you searched for with %s (If it does not appear, you cannot use a quicksearch here)
  5. Add a keyword

Difference between (small s) %s and (Capital S) %S

  1. (small s): %s will have additional substitution replacements: # by %23, % by %25, and /, %2F, @ by %40.
  2. (Capital S): %S will not have substitutions and allow use of C++ in a Google search, allow use of @ in an email substitution, allow use of a fragment-id in a url substitution index.html#example2, and use of a directory as in code/example2.txt.

Note: Mozilla Suite users can use the “Bookmarks → File Bookmark...” feature and edit bookmark’s properties at the moment of its creation.

"Note: Firefox users with Open Book extension can create a bookmark and add keyword property at the same time."

See also

External links