How to Add Your Website to Firefox's Search Bar With OpenSearch XML?

Posted by jcargoo | Tuesday, December 30, 2008
| 0Delicious Twitter Reddit Digg Loading...


I always believed that the search right from your browser’s address toolbar is very helpful especially when you have the ability to customize (to add/remove) the list of the present websites in order to be able to have other(s) than the ones existing by default. But how about creating your OWN website search feature in the browser among others (Wikipedia, Amazon…) which will allow users to search directly on your site? I mean like so:







This is possible thanks to the OpenSearch XML. Let’s first create our XML file which is very simple to understand and to customize (its name will be opensearch.xml):

XML
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>jCargoo Search</ShortName>
<LongName>Youssef ELALAOUI Blog Search</LongName>
<Description>Search what you want in the jCargoo's Blog articles</Description>
<InputEncoding>UTF-8</InputEncoding>
<OutputEncoding>UTF-8</OutputEncoding>
<AdultContent>false</AdultContent>
<Language>en-us</Language>
<Developer>Youssef ELALAOUI</Developer>
<Contact>youssef.elalaoui@jcargoo.org</Contact>
<Description>Search for IT and programming topics like Browser, Add-ons, jQuery, Firefox, Lucene and so on!</Description>
<Tags>youssef elalaoui php css html jquery apache mysql mootools javascript programming struts struts2 ajax google symfony twitter</Tags>
<Attribution>Search data from Youssef ELALAOUI, http://jcargoo.org</Attribution>
<SyndicationRight>open</SyndicationRight>
<Query role="example" searchTerms="Morocco"/>
<Image height="16" width="16" type="image/x-icon">http://www.imageous.net/files/maarhh727hrda6tsnmzb.ico</Image>
<Url type="text/html" template="http://www.jcargoo.org/search?q={searchTerms}"/>
</OpenSearchDescription>
XHTML
Add the following line to the header in order to allow each browser to know that I have an Open Search document available:
<link rel="search" type="application/opensearchdescription+xml" href="http://jcargoo.i8.com/opensearch.xml" title="jCargoo Blog Search" />
Now you can notice that Firefox for example is showing a link that says “Add jCargoo Blog Search” in the browser’s search engine list. If you click on this link, you will be able to see your site whthin the browser with your favicon.

That’s it.







How to encourage this blog if you like it:
  • Promote our sponsors;
  • Add any kind of comment or critic;
  • Ask me directly by email if you prefer.
Just do something like that, and I will have the huge pleasure to continue posting the best of the creativity I have.




Share this post ?

Digg Reddit Stumble Delicious Technorati Twitter Facebook

0 Previous Comments