Sunday, November 16, 2008

Custom Search in Firefox

Firefox allows users to custom search (Top Right Corner) certain websites which have built in search capabilities like Wikipedia, Amazon etc.

How does one go about adding a custom search to a site without inherent search capabilities like eg. ?

Assuming you are in your home directory.

[cheezo@phaedrus ~]$ pwd
[cheezo@phaedrus ~]$ cd `find .mozilla/ -name 'searchplugins' `

[cheezo@phaedrus searchplugins]$ ls
goosh.xml imdb.xml linkedin.xml lkml.xml

Here there are already some xml files for those custom search engines.
lkml.xml is the file of our interest, lets have a look

[cheezo@phaedrus searchplugins]$ cat lkml.xml

<SearchPlugin xmlns="">
<Description>Google Search
<Url type="application/x-suggestions+json" method="GET" template=";client=firefox&hl={moz:locale}&q={searchTerms}"/>
<Url type="text/html" method="GET" template="">
<Param name="q" value="{searchTerms}"/>
<Param name="ie" value="utf-8"/>
<Param name="oe" value="utf-8"/>
<Param name="aq" value="t"/>

<Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/>
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/>

On the 5th line, we have template="". Here site_name = Incase you want to search any other site, replace site_name with that site.

Other terms are self-explanatory.
To ensure a new search engine option shows in Firefox; Firefox needs to be rebooted.

Note:This is my first post which experiments with Cascading Style Sheets (CSS).

Powered by ScribeFire.

1 comment:

Anonymous said...

Many institutions limit access to their online information. Making this information available will be an asset to all.
Custom Paper Writing