The Deep End

go to graworks.com! email!

Tuesday, February 22, 2005

Thunderbird Development: Extensions Introduction

What does this alt thing do


Well, this is my first post of any kind ever! I'm an intern and working on a project which requires the development of extensions for Thunderbird, Mozilla's mail client (see above picture.) Because there's not a lot of documentation for Mozilla--although apparently there are people out there who actually understand how it works--I've had to piece together a lot of juicy informational tidbits which sort of make sense as a cohesive whole.

Mozilla extensions (Firefox or Thunderbird) are composed of two main parts -- the .xul file, and the .js file (javascript). XUL is the xml-based graphical part of Mozilla, and there are extensive tutorials at XulPlanet. XulPlanet mostly just explains how xul can be used for gui's outside of Mozilla (and not specifically for Mozilla) so the best way that I found for learning how xul works is to download an extension and dissect all the files--this way, you can learn Mozilla-specific things like the name of the toolbar you're inserting a button into. Because my extension requires a button, I downloaded Buttons! by Maximum Extension. A great tutorial that explains the basics of extensions can be found on Eric Hamiter's blog , and I'll try not to repeat anything that's stated there.

The javascript is by far the most confusing half of writing an extension. While functions inherent to javascript like alert() are easy, most of the things that you'll want an extension to do are accomplished using XPCOM. An in-depth explanation and tutorial of xpcom can be found here at Mozilla's site. After the basics of all this, the most important part of writing an extension is finding the components/interfaces that you want, and you'll do that at xulplanet. Because xulplanet lists the components, properties, methods, etc., but doesn't actually explain what they mean, I soon developed an unhealthy love-hate relationship with that site, but the complete lack of meaningful information will develop your sixth sense to the uncanny point where you don't even need documentation--although it is xulplanet, not xpcomplanet.

Mozilla's site does have some interfaces documented; the ones that I found that were relevant to my purposes were found here and a few others which will be probably be posted up later. Poking around here would probably be helpful.

That's it for the introduction--later posts will be a lot more specific to certain components and interfaces (the ones that I'm using and happen to understand).

4 Comments:

Post a Comment

<< Home