HowTo: Searchprovider / Browserplugin for IE7 and Firefox – the OpenSearchDescription

Firefox (or Opera, Safari?) introduced a very handy feature: A little searchbox for all your favorite search engines. Microsoft added this in the Internet Explorer 7:

image

image

But how can I create my own plugin? The search provider should be installed with only one click.

The little search box and its provider relies on the "OpenSearchDescription" format.

I added a search provider for this blog – here is the XML:

<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Code-Inside International Blog</ShortName>
<Description>Blogging about .NET, ASP.NET, AJAX, Silverlight</Description>
<Image height="16" width="16" type="image/x-icon">http://code-inside.de/blog-in/wp-content/themes/notso_freshe/images/favicon.ico</Image>
<Url type="text/html" method="get" template="http://code-inside.de/blog-in/?s={searchTerms}"/>
</OpenSearchDescription>

The most important tag is the "Url"-Tag with the "searchTerm" template to create later such an URL: http://code-inside.de/blog-in/?s=AJAX 

Add the search provider to you browser

  • You could use Javascript:
<a href="#" onclick='window.external.AddSearchProvider("http://code-inside.de/blog-in/browserplugin.xml");'>Code-Inside International Blog</a>  

The javascript "AddSearchProvider" method invoke the browser to promt such an interface:

image

  • The browser get noticed about the "search plugin" 

You can tell the clients browser that you offer an search plugin – just add this in the head section of your site:

<link rel="search" type="application/opensearchdescription+xml" href="http://code-inside.de/blog-in/browserplugin.xml" title="Code-Inside International Blog" />

You reference your XML file and (for example) the firefox "search provider icon" show us a glow effect:

image

One click – and you be done:

image

The same process with the Internet Explorer 7:

image

Simple & very usefull for each "search" site :)

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

About the author

Written by Code Inside Team

Currently there is no additional info about this author.

Comment on this post

Recent Posts

  • WebDev Playground: dabblet.com for HTML/CSS, jsfiddler.com for JS & HUrl.it for REST

      What was reserved for mighty Desktop Apps in the past is now coming closer to the web. I’ve going to present three tools to you which are very useful for web developer. At least all the tools are quite cool in there functionality. Playground for HTML/CSS If you need a quick Playground for CSS ...

  • image1452_thumb.png
    Javascript to Dart Translator

      Dart, a Google Javascript alternative was presented a few months ago and the web developer scene are a little bit unsure about the usability of Dart. To declare the language Google has translated the Javascript basics into Dart. The result is this “Translator”. In my opinion the name doesn’t find that well because it’s ...

  • image1366-570x194.png
    Twitter Bootstrap as UI-kit

      HTML and CSS are not foreign words for me but I regret, I’m not a Web designer – I see myself as a webdeveloper. But at least a dressy side is a must. But thank good there are some ready “Systems”. Twitter Bootstrap Twitter Bootstrap is a Toolkit for every kind of Web applications. ...

  • image1441.png
    Fix: the value ‚x‘ is not valid for Foo in ASP.NET MVC

      To get files into the MVC Controller Modelbinding from MVC is a clever method. But in fact it is a little bit complicated to set the error message if the connection failed. Example: public class RegisterModel { ... [Required] [DataType(DataType.EmailAddress)] [Display(Name = "Email address")] public string Email { get; set; } [Required] [Display(Name = ...

  • You Tube API – recall Video Meta files with .NET

      A loooong time ago I’ve blogged about how to access to You Tube with the Google Data APIs. After all that time there are several new ways how to recall files. Google offers You Tube a “simple” surface. If you prefer to do low-Level HTTP calls it is also possible. Aim: I want the ...

Support us