I am quite impressed with IE8 beta 2, annoying bugs aside. One feature of IE8 that is very useful is accelerators, I decided to give it a shot today to see if I could get one working and its surprisingly easy.
You can create an accelerator by writing an xml document in the OpenService Format Specification for Accelerators and making the file accessible from a website, then creating a button with an onclick handler that calls window.external.AddService(url_to_xml_file).
As a quick test I created an xml file to describe an accelerator for my blog similar to the following.
<?xml version="1.0" encoding="UTF-8"?><os:openServiceDescription xmlns:os="http://www.microsoft.com/schemas/openservicedescription/1.0"> <os:homepageUrl>http://www.yoursite.com</os:homepageUrl> <os:display> <os:name>Blog with your site</os:name> <os:icon>http://www.yoursite.com/favicon.ico</os:icon> <os:description>Blog on your site easily</os:description> </os:display> <os:activity category="Blog"> <os:activityAction context="selection"> <os:execute action="http://www.yoursite.com/blog/add_entry.aspx" method="get"> <os:parameter name="title" value="{selection}" type="text" /> </os:execute> </os:activityAction> </os:activity></os:openServiceDescription>
The most notable tags are described below:-
Once this xml document is ready and uploaded all that is needed is a link to it from a html document like the one below.
<html> <head><title>My Blog Accelerator</title></head> <body> <button id="installButton" onclick="window.external.AddService('my_accelerator.xml');">Add My Blog Accelerator</button> </body></html>
The example above would require the html document to be in the same path as my_accelerator.xml.
And thats all there is to it, the documentation for developing accelerators can be found on msdn.
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.