How to Create a Firefox Search Plugin (Extension)

The Firefox browser (as of version 3.0.2 and likely earlier versions), there is a search bar at the top right. Custom search engine plugins are available to allow easier searching. For this example, I will demonstrate how to create search engine for the search engine Scour. We will begin with a template which should be copy and pasted into an xml file (in our case, it will be scour.xml).

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
   xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>engineName</ShortName>
<Description>engineDescription</Description>
<InputEncoding>inputEncoding</InputEncoding>
<Image width="16" height="16" type="image/x-icon">engineImage</Image>
<Url type="text/html" method="method" template="searchUR" />
</OpenSearchDescription>

Now that we have our template, we need to make custom changes for our search engine. We will go through each of the colored changes:

engineName
This simply shows the search engine name that appears on the browser in gray before a search term is entered. In our example, the search engine name is Scour.

engineDescription
This one is a search engine description. Scour’s search engine description is, “Search Socially”.

inputEncoding
This is the encoding for the search engine. In most cases, this should be “UTF-8″.

engineImage
This is the image that will represent the search engine. Note that generating this portion will most likely require an online tool. The image should be a 16×16 or 32×32 image converted to type image/x-icon. The template above is cofigured for a 16×16 images. Be sure to adjust the width and height to 32×32 if you decide to use a 32×32 sized icon. An example of a suitable image is the search engine’s default shortcut icon found in the the meta information of the website. To generate the text representation of the image, go to The data: URI kitchen. Below is a quick tutorial on how to use use URI kitchen:

  1. Insure that the “base64″ checkbox is checked.
  2. Either insert an online http link to the image or browse to a local copy on your computer in the correct input field.
  3. Click the Generate button. Note that the result required for engineImage field will be outputted to your browser’s Location Bar (URL bar).
  4. Copy and paste the result into your xml document.

searchURL
This is the most important field and will determine whether your search plugin correctly performs a search. Because each search engine is different, we will go through a step by step process of how to obtain this information for the Scour search engine.

  1. Go to their main website at Scour.com.
  2. Input the following search term without the quotes: “findMe”. Click Search.
  3. On the search results page, we will examine the URL. As of the writing of this document, the resulting URL was: http://www.scour.com/search/web/findMe.
  4. We then want to replace the string “findMe” with “{searchTerms}”. The result of this step (and the searchURL data) should be: http://www.scour.com/search/web/{searchTerms}.

We have now completed the xml file for our search engine. We will now go through the process of testing to ensure that our Firefox Search Plugin works:

  1. Make sure your XML file is free of errors by opening the file in Firefox (should be as easy as double clicking on the xml file in windows explorer or your windows desktop). If you have problems at this step, the most common errors is a tag might be overwritten.
  2. Assuming Firefox 3.0.2 was installed into it’s default directory, the local directory to place this xml file is: C:\Program Files\Mozilla Firefox\searchplugins.
  3. Restart the Firefox browser.
  4. On the fresh Firefox browser load, check the search engine dropdown to see if your newly created search engine is there. If the search engine image is blank, verify that the information you used for engineImage is correct. Recreate another copy if you have to!

This just about sums up how to create a Firefox Search Engine plugin. Let me know how this works!

Share and Enjoy:
  • Digg
  • DotNetKicks
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Live
  • MySpace
  • Netvibes
  • Reddit
  • StumbleUpon
You can leave a response, or trackback from your own site.

6 Responses to “How to Create a Firefox Search Plugin (Extension)”

  1. Palapple Blog | SEO Solutions for your Business…

    Thanks for sharing. Search engine optimization is indeed one of the most crucial areas in Internet marketing, it is a perfect bridge between technology and business….

  2. will smith says:

    Hello Victor, I’m looking for how to program an extension to combine ie8, firefox 3,
    chrome, orca, and avant browers into one extension menu as explained in firefox
    facts.com/2008/09/22/quickly ccess all browers from firefox page.

    RE: http://www.flicker.com/photo/85348538@N00/28796824681

    Thanks, will.

  3. Reuben says:

    Thanks, the part about the icon helped me the most as I couldn’t find that elsewhere….

  4. affiliate.solutions says:

    Very nice information. Check out my blog, I just posted a great blog about the 36 Best Wordpress plugins for 2009.

  5. Prateek says:

    I’ve made one extension for my site http://www.chillgeeks.com, when I am uploading it to Mozilla Add-on site, it is saying that XML formatting is improper..
    Tell me what to do.

  6. Jayesh says:

    Thanks It’s Nice Example For Class Learner Begener in PHP…

    Rallly Thanks……..

Leave a Reply