My First Chrome Extension
January 8, 2010 2 Comments
I am fairly hooked on Microsoft Outlook and I like to use the RSS reader function. I also have been living in Chrome 4 instead of Firefox for a few weeks now. One of the features of Firefox and IE is the ability to discover RSS and ATOM feeds and pass them to the registered feed reader.
Google has an extension for Chrome that almost does what I want. It discovers the feeds but it will only subscribe them with a web-based feed reader. What I did was hack on the RSS Subscriptions Extension (by Google) so that it would work with Outlook.
Outlook feeds by registering itself as the handler for the FEED scheme.
That means anything that tries to invoke a URI like feed://somewhere.com/feed.rss, Outlook will be invoked with the /share switch like this:
Outlook is very picky about the scheme on the URL. It has to be feed:// or it won’t work and that is the problem with the Google extension. It always puts the http:// scheme onto the URL and it assumes that you are going to embed this into a larger querystring to a web-based feed aggregator.
It was pretty easy to tweak the extension to do what I wanted. The meat of the change is really just one line of code:
url = url.replace( "%f", feedUrl.replace( "http:", "feed:" ) );
That makes it so that %f is a feed: scheme URI that will invoke the registered feed handler. For me this is Outlook 2010.
There is a little bit of supporting stuff here and there to make this work, but that’s the gist. Now, %f is the magic configuration to invoke the registered feed:// scheme application. It was surprisingly easy to get hacking on the extension and Google made it very easy to publish my work.
If this scratches your itch, you can get it from Chrome Extensions site.