Saturday, October 21, 2006

How to add your site or your favorite side to firefox sidebar search engine

You're a firefox fan? You're a webmaster or web developer? Ever want to add a customized search engine to firefox (top-right) side-bar? Great! Then this tip(not a new technique at all) is for you. Here is the instruction of how:

First you need to create a 16x16 pixels png image (as search engine icon)
Second, make a file.src as the following structure
version="" #version number
name="" #engine name e.g:Google
description=""
method="" #Get/Post
action="" #search url, where the html form goes
searchform=""
queryEncoding='' #This field is optional, e.g:ISO-8859-1
queryCharset='' #This field is optional, e.g:ISO-8859-1
>

#parameter(s)
< input name="" user>
< /search>

update="" #url to get the lastest src file
updateIcon="" #url to get the lastest src file
updateCheckDays="" #datatype: int
>

Easy,hum! Of course, before you perform the above steps, make sure you website or your favorite site has a search engine. Finally, put this script into a page(locally or remotely)

function addEngine(name,ext,cat)
{
if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function"))
{
var url=""; #your url
window.sidebar.addSearchEngine(
url+name+".src",
url+name+"."+ext,
name,cat );
}
else
{
document.write("oops,error");

}
}

javascript:addEngine('title','image_format','search_category')
More info at http://mycroft.mozdev.org/deepdocs/installing.html#manual

In case you get tired of it, simply remove the src and png.
Profile Folder can be found at here

No comments: