Tuesday, January 13, 2009

Somebody make IE extensions easier!!

I have written a number of things in the Firefox XUL extension environment, some of which I keep to myself, some of which I publish. When it comes to actually trying to build a product around an extension (which is a hard sell anyway), having just a firefox extension is a non-starter. For my latest project re-searchr.com I am exactly in this position, I have a Firefox extension that I have spent a lot of time on, which works fairly well. However since Firefox is only 22% (and rising) of the browser market share, I can't really get all that far. I need an IE extension.

IE extensions are difficult, you have to have Visual Studio .net and you have to know C# or VisualBasic, Visual C++ or [insert microsoft specific language here]. I don't know any of these languages and do not use Visual Studio, so I am at an extreme disadvantage. It would take a long time for me to climb the learning curve to make a very good IE extension. Ideally Microsoft would see this as a bad thing and come out with a more web developer friendly api to IE, but that is not likely to happen.

So I need work arounds. My first step and one that would have been a good idea anyway is to port my Firefox extension functionality to a bookmarklet. My re-searchr toolbar wants to capture page load events, which is impossible with a bookmarklet, but if I treat the bookmarklet click as a load event I can follow a similar process as the Firefox extension to produce inline analysis to a users search results page (this is what re-searchr does).

This actually went fine, the only hiccup being cross-site scripting (which in the extension sandbox in Firefox is NOT a security problem), which I solved using JSON and adding "SCRIPT" tags to the page instead of using XMLHTTPRequests. So now I have partial functionality in a bookmarklet, this is a good thing. Why? Well a lot of people don't want to download toolbars, so if you can build a bookmarklet that shows off what your toolbar will do (at least partially) then folks can "try before buy" your toolbar, see if they like the results and then download the toolbar.

I digress, I still want a IE based extension for re-searchr, and now I have a set of code in a bookmarklet that will properly run in IE (all Firefox specific extension stuff is removed). This should not be all that hard, what I need is a IE BHO (browser helper object) that will, at the very least, add my bookmarklet javascript onto a page and run it's "start" function on page load. This seems like it should be trivial, and if someone could write this BHO then web developers could develop things as JS/HTML/Flash based web apps and plug them into this framework (which just loads javascript onto a tab's page) and vwhala we have an extension environment for IE. For bonus points:

  1. If the BHO could also set the security constraints to allow cross domain XMLhttprequests in the context of the javascript that BHO loads (not sure if this is possible) then that would be bonus points, and would really allow for a lot more functionality
  2. The BHO allow attachement to page load events, so that the developer could detect if the page loaded is something he wants to play with (to remove ads, or change content), and then either exit, or load the rest of the javascript (so as decrease the load on the browser, load a bit of js to determine whether to load the rest).
  3. The BHO, could become a full fledged javascript API into the Microsoft IE API, this would ideal and awesome.
This seems like an absolute no brainer, download some prebuilt BHO code, with a properties file specifing where the javascript files live (urls, or maybe files in the install package), and the initial callback, fill in the properties, package, and use. I'd pay a $100 one time fee to get the code that I can then distribute as my extension.

So why hasn't this happened? Is this really hard? Maybe someone will read this and give me some feedback.
blog comments powered by Disqus