Building a Thunderbird extension 4: chrome manifest

The file called chrome.manifest tells Thunderbird what packages and overlays are provided by the extension. Open the file called chrome.manifest that you created and add this code:

content     myfirstext    content/
  • content specifies the type of material in the package
  • myfirstext is the name of the chrome package (specified in the first segment of <em:id> in the install.rdf file
  • content/ Is the location of the package's files and used when resolving the URI chrome://myfirstext/content/....

So, this line says that for a chrome package myfirstext, we can find its content files in the directory content/ (which is a path relative to the location of chrome.manifest).

To change the Thunderbird user interface to support the extension, you create an overlay and then merge it with the default Thunderbird interface. Later in the tutorial we will create a XUL overlay file that will merge with the default messenger.xul file. At this point we are going to specify in chrome.manifest the existence of the overlay (which we will create later).

Add this line at the end of chrome.manifest:

overlay chrome://messenger/content/messenger.xul chrome://myfirstext/content/myhelloworld.xul

This tells Thunderbird to merge myhelloworld.xul into messenger.xul when messenger.xul loads. For more information on chrome manifests and the properties they support, see the Chrome Manifest Reference.

It can be useful to install an add-on such as the DOM Inspector to better understand the layout of existing XUL files and to debug your own overlays. (not supported as of Thunderbird 60)

Document Tags and Contributors

Last updated by: apiraino,