Tuesday, November 10, 2009

How to create a IE8 Accelerator

1. Create the below XML file.



1: xml version="1.0" encoding="UTF-8"?>
  2: <openServiceDescription xmlns="http://www.microsoft.com/schemas/openservicedescription/1.0">
  3:   <homepageUrl>http://www.google.com/csehomepageUrl>
  4:   <display>
  5:     <name>Search Digital Inspirationname>
  6:     <icon>http://search.labnol.org/favicon.icoicon>
  7:   display>
  8:   <activity category="Search">
  9:     <activityAction context="selection">
 10:       <execute action="http://www.google.com/cse">
 11:         <parameter name="q" value="{selection}" type="text" />
 12:         <parameter name="cx" value="010722013183089041389:nu0knrjwib8" type="text" />
 13:       execute>
 14:     activityAction>
 15:   activity>
 16: openServiceDescription>




You can add more parameters as required by the provider.






2. Create a link on your webpage so that the user can add the accelerator to the browser first time.


<a href="javascript:window.external.AddService('http://example.com/search.xml')">Install Acceleratora>



 or a button



<button onclick="window.external.AddService('http://example.com/search.xml')">Add Search Acceleratorbutton>