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

  • Automated Security Analyser for ASP.NET websites

    Evil Hackers are lurking everywhere and many Web-applications are delicately and share “too much” with the attacker. A quick (first!) overview offers the Tool “ASafaWeb”. All the website does is making a few requests and writing an Analyses including problem solving’s. There are no permanent disadvantages (bad requests/ DoS attacks and so on). Example: KnowYourStack.com ...

  • image1489-570x194.png
    „Sign in with Twitter“ for your own ASP.NET WebApp

      “Sign in with Twitter” is a popular practice to authenticate the users on your website. One advantage compared to an own registration is the lower inhibition for the user. But on the other hand Twitter doesn’t fess up with all the information’s and you will get into a kind of addiction. At the end ...

  • image1485-570x194_thumb.png
    CodePlex is going to be updated

      CodePlex the Microsoft Open Source Project Hosting Plattform hasn’t changed that much in the last few years and for a few times I thought Microsoft stopped the whole developing process. But now I found out that there is still life in the project. Maybe it is because of the success of GitHub or because ...

  • image1474_thumb.png
    What does Adobe in the flash-free web? Magazine-Style Layouts with CSS Regions!

      Adobe is well known for Photoshop and Flash but of course there is a lot more. According to the “Future Post” from Google Adobe declared one of their big subjects on a Blogpost. I’m talking about the W3C Working Draft to CSS Regions. Adobe cooperates with the WebKit Team and W3C on this. What ...

  • image1471-523x194.png
    HTML 5 Games, Tooling & 3D

      Game Developing is an interesting subject for all kind of software developer. But as a web developer without any Flash-skills there aren’t that much starting points. With HTML5 and the combination between Javascript, CSS3 and fast browsers there are the first “robust” HTML5 games. HTML5 games? Is this real? Neowin created a “Top 10” ...

Support us