For our first extension, we will add some text to the Thunderbird status bar. The status bar is implemented in a XUL file called
messenger.xul, which can be found in the
chrome/messanger/content/messenger folder. To view this XUL file use the DOM Inspector extension or look inside the omni.ja archive, which is located in the Thunderbird program folder. It's contents can be easily browsed by copying the file to a different location and renaming it to omni.zip. In
messenger.xul we find the status bar, which looks something like this.:
<statusbar id="status-bar" ...> ... <statusbarpanel>s ... </statusbar>
<statusbar id="status-bar"> is a "merge point" for a XUL overlay. XUL Overlays are a way of attaching other UI widgets to a XUL document at run time. A XUL Overlay is a
.xul file that specifies XUL fragments to insert at specific merge points within a "master" document. These fragments can specify widgets to be inserted, removed or modified.
In this example you are adding a line to the indented statusbar. Therefore it becomes an item owned by the id called "
status-bar". This shows how the Thunderbird architecture allows extensions to modify the user experience without modifying the installation files. This also enables version independence between Thunderbird and Thunderbird extensions.
Example XUL Overlay Document
Create a new file called
myhelloworld.xul within the
content folder you created earlier with the following content:
<statusbar> widget named
status-bar specifies the merge point within the application window that we want to attach to. When parsing our overlay file, the XUL engine will take all child elements of the <statusbar> tag and merge them with the original XUL document's <statusbar> tag. In the example above we have defined a new <statusbarpanel> item (that can be referred to as