indiWiz.com

Subhash's Tech Log

Archive for the ‘webbrowser’ tag

OpenSearch search providers and browsers

with one comment

All the major browser vendors support the OpenSearch format (yes, this means including Microsoft IE8) for registering a search provider in your browser.

Writing a OpenSearch provider

Recently I wrote a search provider for my favorite book-buying site, Pustak.co.in:

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
	<ShortName>Pustak.co.in</ShortName>
	<Description>Pustak.co.in provider</Description>
	<InputEncoding>UTF-8</InputEncoding>
	<Url type="text/html"
		template="http://pustak.co.in/pustak/books/search?q={searchTerms}&amp;type=book&amp;page=1"/>
</OpenSearchDescription>

Hosting your search provider

To let people use your search provider, you need to host it in the web. For our example, let us assume that you host it here: http://yourhost/your_opensearch.xml.

The MIME type of this document can be left to its default application/xml, or can be made OpenSearch specific: application/opensearchdescription+xml.

Using JavaScript to register a provider

After deploying the OpenSearch XML in your host, we need to write a JavaScript function to register the provider with your browser:

<script type="text/javascript"> 
function registerYourSearchProvider(){
  window.external.AddSearchProvider("http://yourhost/your_opensearch.xml");
}
</script>

This JavaScript worked with Firefox, IE8 and Google Chrome. Opera 10 was not able to understand it.

Auto-discovering OpenSearch providers

Recently when I saw my Google Chrome search providers, I saw this list:

Chrome Search Providers

I was surprised to see this list because there are providers that I have not added specifically. How was Google Chrome “discovering” these providers?

A look into the HTML source of one of the auto-registering search provider, I found the following info (in the <head> section):

<link rel="search"
       href="/mavensearch.xml"
       type="application/opensearchdescription+xml"
       title="mavensearch.net" />

To let browsers auto-discover you as a search-provider, add the above in your sites!

Written by Subhash Chandran

November 25th, 2009 at 10:36 am

Posted in Uncategorized

Tagged with , ,

Best WebDeveloper plugins for Firefox

without comments

I found this interesting link listing the most interesting Firefox plugins.

Written by Subhash Chandran

August 7th, 2009 at 4:56 am

Posted in Uncategorized

Tagged with ,

Google Chrome in Linux

with one comment

Google Chrome in Linux

Get it from the Early Access Release Channel.

Written by Subhash Chandran

June 17th, 2009 at 3:33 am

Posted in news

Tagged with , ,