If you are working on some extension for such site, you can also create and install search plugin for the site.
There are two search plugin formats supported by Firefox:
MozSearch and OpenSearch. Hope that above links will help you to create necessary search plugin.
Then you need to distribute it with your extension. You should do two basic things:
1. Create
searchplugins
folder in the root of your extension.2. Add your search plugin to this folder.
So, inside XPI your
searchplugins
folder will be located on the same level with chrome.manifest
and install.rdf
files.There is also one small trick that can be used in your extension. You can select your installed search plugin as default search provider on the first run of your extension. To do that simply add two lines of code:
var sb = document.getElementById("searchbar");
sb.searchService.currentEngine = sb.searchService.getEngineByName("YourEngineName");