Search code examples
firefoxpluginsfirefox-addonsearch-engine

Including a Search Plugin in my Firefox Extension


I am developing a Firefox Extension (Firefox 3.6 and up) and i would like, when the user installs my extension to:

  1. Add my own Search Engine to the list of available Search Engines in Firefox.
  2. Change the default search engine to my new installed search engine.

How strange that it is, I couldn't find much help in the Mozilla Developer Network and Googeling it...

Thanks. Aviv


Solution

  • Just put your search plugin definition in the searchplugins/ subdirectory of your extension (see https://developer.mozilla.org/en/Bundles). Set browser.search.selectedEngine to the name of your engine to make it the default.