IE8 Rocks! Creating Custom Accelerators

Internet Explorer 8 Beta 2 is currently available.  If you haven't downloaded it yet, you can find it here.  I have been using it for about two months now and I am really enjoying some of the new features.  One of the features that I find particularly interesting is Accelerators.

Here is a brief introduction about what Accelerators are (taken directly from the IE8 site):

Accelerators give you ready access to the online services you use everyday—from any page you visit. Now you can simply select some text and then click on the blue Accelerators icon. For example, you may be interested in the location of a business featured on a webpage. In the past, you would need to copy the address from the webpage, navigate to another the webpage for a mapping service, and paste in the address. With the "Map with Live Maps" Accelerator in Internet Explorer 8, you can get an in-place view of a map displayed directly on the page.

 image

"Accelerators", Internet Explorer 8: Faster and Easier, https://www.microsoft.com/windows/internet-explorer/beta/features/accelerators.aspx

IE8 comes with a handful on pre-installed Accelerators as you can see from the menu above.  There are also some more available here.  You can also create your own custom accelerators quickly and easily.  The documentation for creating accelerators can be found on the Accelerators Development Guide.

I decided to create a simple one to search the MSDN Library for the text that you have selected on a page in the IE8 browser.  To create an accelerator, you just need to write an XML file that conforms to the OpenService Accelerator Schema and contains the information about the accelerator.  Here is the XML file for my MSDN Search Accelerator:

    1: <?xml version="1.0" encoding="UTF-8" ?> 
    2: <os:openServiceDescription xmlns:os="https://www.microsoft.com/schemas/openservicedescription/1.0">
    3:     <os:homepageUrl>https://social.msdn.microsoft.com/</os:homepageUrl> 
    4:     <os:display>
    5:         <os:name>Search MSDN</os:name> 
    6:         <os:icon>https://msdn.microsoft.com/favicon.ico</os:icon> 
    7:         <os:description>Search the MSDN Documentation.</os:description> 
    8:     </os:display>
    9:     <os:activity category="Search">
   10:         <os:activityAction context="selection">
   11:             <os:execute action="https://social.msdn.microsoft.com/Search/en-US/?query={selection}" method="get" /> 
   12:         </os:activityAction>
   13:     </os:activity>
   14: </os:openServiceDescription>

As you can see, you just provide some basic information about the accelerator and specify the action to take when the user invokes it.  In the above example, we are just adding whatever text the user has selected to the URL for the MSDN Search site (line 11).

To install an accelerator, it has to be hosted somewhere on a web server.  It cannot be installed from the hard drive.  The code below shows a button that allows you to install an accelerator service:

    1: <button id="myButton"
    2:     onclick="window.external.AddService('https://www.softwareapproach.com/IE8accelerators/msdnaccelerator.xml')">
    3:     Add MSDN Search Accelerator to Internet Explorer 8</button>

Click the button below to install the MSDN Search Accelerator if you want to give it a try.

Add MSDN Search Accelerator to Internet Explorer 8

 

The MSDN Search Accelerator will now appear in your menu when you select some text on a web page in IE8.  And upon clicking, it will open a new tab with the MSDN Search results for the selected text.  The images below show the accelerator in the menu and the result of invoking the accelerator.

image

image

 

There are tons of uses for accelerators.  The possibilities are endless.  In addition to just linking to another web site, you could create a custom web service that users could submit information to via an accelerator for some sort of processing.  I really like the way that IE8 was designed and the easy extensibility and customization that it provides to users.  So give IE8 and accelerators a try!  If you come up with some cool accelerator ideas, let me know.  I am interested to see the ideas that people come up with.