Adapt to Changes in Thunderbird 103-115
Last updated
Was this helpful?
Last updated
Was this helpful?
This document tries to cover the internal changes that may be needed to make Experiment add-ons compatible with Thunderbird Supernova. If you find changes which are not yet listed on this page, you can ask for help and advice in one of our .
Each mail3PaneTab
and mailMessageTab
in Thunderbird's main messenger window is now loaded into its own browser element, instead of sharing and updating a single browser.
A general and very helpful introduction to the new front end can be found in its .
The mail3PaneWindow
(about:3pane
) can now be accessed as follows:
window.gTabmail.currentAbout3Pane
window.gTabmail.currentTabInfo.chromeBrowser.contentWindow
window.gTabmail.tabInfo[0].chromeBrowser.contentWindow
window.gTabmail.tabInfo.find(
t => t.mode.name == "mail3PaneTab"
).chromeBrowser.contentWindow
Options #1 & #2 will only work if the current active tab is a mail3PaneTab
. Option #3 assumes the first tab is always a mail3PaneTab
.
The mailMessageWindow
(about:message
) can be accessed similarly:
window.gTabmail.currentAboutMessage
window.gTabmail.currentTabInfo.chromeBrowser.contentWindow
mail3PaneWindow.messageBrowser.contentWindow
window.messageBrowser.contentWindow
Option #1 will only work if the current tab is a mail3PaneTab
or a mailMessageTab
. Option #2 will return the mailMessageWindow
, if the current tab is a mailMessageTab
(it will return the mail3PaneWindow
, if the current tab is a mail3PaneTab
). Option #3 will return the nested message browser of a mail3PaneTab
through its mail3PaneWindow
as defined in the previous section. Option #4 will return the message browser of a message window.
Some of the global objects defined in Thunderbird's main messenger window have been moved into the mail3PaneWindow
(about:3pane
) and/or the mailMessageWindow
(about:message
). Some objects have been removed.
gDBView
: Available in mail3PaneWindow
and in mailMessageWindow
.
gFolderDisplay
: Removed. Find displayed folder via mail3PaneWindow.gFolder
.
gMessageDisplay
: Removed. Find displayed message via mailMessageWindow.gMessage
or mailMessageWindow.gMessageURI
.
Useful functions, methods and objects which have been moved from elsewhere:
mail3PaneWindow.displayFolder(folderURI)
mail3PaneWindow.messagePane.displayMessage(messageURI)
mail3PaneWindow.messagePane.displayMessages(messageURIs)
mail3PaneWindow.messagePane.displayWebPage(url)
mail3PaneWindow.folderPane.*
mail3PaneWindow.folderTree.*
mail3PaneWindow.threadPane.*
mail3PaneWindow.threadTree.*
mailMessageWindow.currentHeaderData
mailMessageWindow.currentAttachments
It is recommended to leverage WebExtension APIs as much a possible. Instead of adjusting to core changes, the following WebExtension APIs can be helpful:
There may already be a shared Experiment, which could help with add-on updates (or which could give helpful hints):
The folderTree
and threadTree
in about:3pane
(the mail3PaneTab
) no longer use the deprecated XUL tree
elements, but have been replaced by HTML lists
and HTML tables
.
Known attributes which have to be replaced:
For a backward compatible solution, use
Removed in Thunderbird 115. Can be replaced as follows:
OS.Constants.Sys.Name
-> Services.appinfo.OS
OS.Constants.Path.profileDir
-> PathUtils.profileDir
OS.Constants.Path.tmpDir
-> PathUtils.tempDir
In Thunderbird 106, this has been changed from an enumerator to a simple array.
Removed in Thunderbird 106.
Renamed in Thunderbird 108 to containsKey()
. Example msgHdr.folder.msgDatabase.containsKey()
.
Content processes, such as the extension process executing "child" experiment code, are subject to additional restrictions compared to Thunderbird 102. Known limitations include:
Raw TCP socket operations never complete, even if timeouts are set up. It is likely that other networking primitives are affected in a similar way.
The CSS feature -moz-image-region
has been removed. It is no longer possible to specify a button icon or a list-style-image
as a region from a larger image. Add-on developers have to resort to individual images.
This holds instructions on how to find other moved objects and functions.
Use the to add buttons to Thunderbird's unified toolbar
Use the to add entries to Thunderbird's context menu (for example in the folder pane or in the thread pane)
Use the to register keyboard shortcuts. Additional benefit: all WebExtension shortcuts can be adjusted by the user in the Add-on Manager according to their needs.
Use the to interact with the mail tab.
community Experiments listed on
Experiments from the repository
Experiments from the repository (scheduled to be shipped with Thunderbird soon)
The mail toolbar has been replaced by the unified toolbar. Adding your own buttons will become difficult, because the unified toolbar tends to remove unknown objects. Instead, use the to add buttons.
Mozilla continued to remove XUL in favour of standard HTML5/CSS. The most relevant changes are related to the XUL flexbox. A very helpful read is .
height
: replace with
width
: replace with
flex
: replace with (a very helpful tutorial is available at )
Important: If add-ons still create old-fashioned XUL dialogues and load *.xhtml
files, it is not recommended to invest time into fixing them. It is more efficient to re-create them as pure *.html
files. They can be opened using the or the .
Removed in Thunderbird 103. The in API implementation scripts. If needed in self-created JSMs, it can be accessed as follows:
OS.File.*
->
OS.Path.*
->
In consequence, you might need to move some functionality from "child" experiment code to the "parent" context. One way to achieve this is to implement the necessary functionality as a regular asynchronous API method in the "parent" experiment (without extending the API schema), then using await context.childManager.callParentAsyncFunction("your_api_name.some_function", [arguments, passed, to, some_function])
to call it from the child experiment. Note that function arguments passed in between processes are subject to the .