The base chrome directory of Thunderbird can sometimes appear confusing when you're just beginning to look at it. As such, I've always thought it would be nice to have a list of what xul
, js
, or other files are here, what they do, and where they overlay at different points within the client. Things appear confusing for several reasons:
- Much of the code is written to be portable, so instead of duplicating it, its been put in overlays that are loaded over many different types of windows.
- Some of the code was written based off of early Firefox code, but is not exactly the same. You’ll sometimes see reimplementations of things that are already in toolkit, written specially for Thunderbird.
messenger.xul
The base mail window that you see when you first open Thunderbird is messenger.xul
: messenger.xul
itself doesn’t contain a lot. Its main focus is on handling the folderpane, threadpane, and the message preview sections shown above. The rest is loaded from overlays:
- mailWindowOverlay.xul
- This is the red sections shown in the interface above, including the toolbars, notification bars, and the status bar, but also includes most of the commands, keysets, and context menus of Thunderbird, along with a whole lot of Javascript.
- mailOverlay.xul
- A really small overlay that only adds a few “New message” and “New Card” commands to the menus, along with their associated javascript.
- msgHdrViewOverlay.xul
- Shown in blue above, this overlay consists of three boxes. Two are stacked showing either a brief or expanded view of the headers. The third is the attachment box which can be toggled into a slim or an expanded view
- baseMenuOverlay.xul
- Contains the contents of most of the menus (i.e. File, Edit, View, etc).
- OSX Only: macMenuOverlay.xul
- A special overlay for OSX that adds a few items to the
window
menu.
messageWindow.xul
messageWindow.xul
is shown when a message is opened. Its almost exactly the same as messenger.xul
in terms of overlays, but just lacks the folder and threadpanes normally shown. Menus, toolbar buttons, and headers are all taken from exactly the same overlays listed above though.
- mailWindowOverlay.xul
- This is the red sections shown in the interface above, including the toolbars, notification bars, and the status bar, but also includes most of the commands, keysets, and context menus of Thunderbird, along with a whole lot of Javascript.
- msgHdrViewOverlay.xul
- Shown in blue above, this overlay consists of three boxes. Two are stacked showing either a brief or expanded view of the headers. The third is the attachment box which can be toggled into a slim or an expanded view
- baseMenuOverlay.xul
- Contains the contents of most of the menus (i.e. File, Edit, View, etc).
- OSX Only: macMenuOverlay.xul
- A special overlay for OSX that adds a few items to the
window
menu.
customizeToolbar.xul and customizeToolbarSheet.xul
These are two old files from when the original customizable toolbars were ported from Firefox (Phoenix at the time) to Thunderbird (Minotaur at the time). customizeToolbar.xul
looks and acts a whole lot like the toolkit's customizeToolbar.xul. Items have the same ID’s, and contain the same structure. A few odd pieces are missing though. For instance, the “Add New Toolbar” buttons from toolkit aren’t in the Thunderbird version. customizeToolbarSheet.xul
is a similar implementation written for OSX to give a more native appearance. At compile time these files are added to the toolkit directory so that their chrome addresses are in global, the same as Firefox’s.
Why this is this way, I’m not sure at the moment. I assume that customizeToolbars was originally not in the toolkit, but in Firefox's chrome, or that there were some special changes wanted for Thunderbird's implementation at some point. Regardless, it seems to still be that way now.