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. To view this XUL file use the DOM Inspector extension or look inside the omni.jar archive. 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
<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
Take the sample code from above and save it into a new file called
myhelloworld.xul within the
content folder you created earlier.