Firefox Extensions written in GWT, revisited

I briefly blogged earlier this year about our internal project that allowed us to write Firefox extensions using the Google Web Toolkit framework. I’m happy to say that I’ve just pushed out the first version of the code for developers to start playing with.

Building a Firefox extension isn’t much different than writing a standard GWT web application. There are some caveats: there isn’t a global window ($wnd) or document ($doc) and the GWT widget system doesn’t work without some tweaks. You can, however, take advantage of GWT’s extensive DOM bindings to manipulate pages that the user loads and interact with the Chrome DOM to add toolbar buttons and menu items. I’m slowly working on extracting the code to work with these browser elements from our proprietary codebase, cleaning them up and pushing them into the open-source project.

For now, the current version of gwt-firefox-extension should be sufficient to write an application with the same functionality as a greasemonkey script without dipping into more advanced concepts. We’ve also generated bindings for the whole set of XPCOM IDL, so you’ll have access to most every service and component in the browser if you need to do something more complicated.

Try it out and join our open-source mailing list if you’ve got any feedback or suggestions.

4 Responses to “Firefox Extensions written in GWT, revisited”

  1. It’s close to my idea: building a Jetpack-based Firefox’s extension using GWT.

    See http://www.jroller.com/dmdevito/entry/gwt_and_jetpack_are_going

    I like to see you have developed similar/close ideas ;-)

    • Matt Mastracci says:

      I’ll probably port this over to Jetpack once it’s shipped on a sufficiently large set of browsers. Jetpack’s additional download size is a big deterrent. If you compile an extension with this framework, you’ll be shipping 20kB of code, vs. 1MB of Jetpack + your 5kB script.

      • Well, IMHO, Jetpack will have a huge impact on Firefox for the following reasons.
        (1) Jetpack will enable more programmers to code extension
        (2) nobody cares about downloading 1Mo (without Jetpack) or 2Mo (with Jetpack included)
        (3) AFAIK, Jetpack will be included into Firefox 4 (end of 2010).

  2. Kumaresan says:

    Sounds interesting. Will keep it in mind and use it sometime in future.

Leave a Reply

You must be logged in to post a comment.