LogoLogo
  • About Thunderbird
  • Contributing to Thunderbird
    • Getting Started Contributing
    • Setting Up A Build Environment
    • Building Thunderbird
      • Windows Build Prerequisites
      • Linux Build Prerequisites
      • macOS Build Prerequisites
      • Artifact Builds
    • Codebase Overview
      • Account Configuration
      • Address Book
      • Chat Core
        • Notifications
        • Message Styles
        • Keyboard shortcuts
        • Chat Core Protocols
        • Contacts
      • Mail Front-End
    • Tutorials and Examples
      • Hello World Example
      • Thunderbird Live Development Videos
    • Fixing a Bug
      • Bug Triaging 101
        • Bug Status Classicification
        • Bug Types
        • Garbage Collection
        • Narrow the Scope
      • Using Mercurial Bookmarks
      • Using Mercurial Queues
      • Lint and Format Code
      • Using ESLint to Format Javascript Code
      • Try Server
      • Landing a Patch
      • Care and Feeding of the Tree
    • Testing
      • Running Tests
      • Adding Tests
      • Writing Mochitest Tests
  • Planning
    • Roadmap
    • Android Roadmap
    • Supported Standards
  • Add-on Development
    • Introduction
    • What's new?
      • Manifest Version 3
    • A "Hello World" Extension Tutorial
      • Using WebExtension APIs
      • Using a Background Page
      • Using Content Scripts
    • A Guide to Extensions
      • Supported Manifest Keys
      • Supported UI Elements
      • Supported WebExtension APIs
      • Thunderbird's WebExtension API Documentation
      • Thunderbird WebExtension Examples
      • Introducing Experiments
    • A Guide to Themes
    • Developer Community
    • Documentation & Resources
      • Tips and Tricks
    • Add-on Update Guides
      • Update for Thunderbird 128
      • Update for Thunderbird 115
        • Adapt to Changes in Thunderbird 103-115
      • Update for Thunderbird 102
        • Adapt to Changes in Thunderbird 92-102
      • Update for Thunderbird 91
        • Adapt to Changes in Thunderbird 79-91
      • Update for Thunderbird 78
        • Adapt to Changes in Thunderbird 69-78
      • Update for Thunderbird 68
        • Adapt to Changes in Thunderbird 61-68
      • How to convert legacy extensions?
        • Convert wrapped WebExtensions to modern WebExtensions
        • Convert legacy WebExtensions to modern WebExtensions
        • Convert legacy overlay extension to legacy WebExtension
        • Convert legacy bootstrapped extension to legacy WebExtension
  • Releases
    • Thunderbird Channels
    • Release Cadence
    • Uplifting Fixes
    • Feature Flags
    • Tracking Fixes for Releases
    • Contributing to Release Notes
Powered by GitBook
On this page
  • Changed API
  • nsISimpleEnumerator, nsIArray and nsIMutableArray
  • fixIterator() & iteratorutils.jsm
  • nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL
  • nsILoadInfo.SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS
  • nsIMsgCompose.SendMsg
  • nsISocketTransportService.createTransport
  • IOUtils.jsm
  • Renamed or Replaced API
  • nsIMsgCopyService.CopyFileMessage
  • nsIMsgCopyService.CopyMessages
  • nsIMsgCopyService.CopyFolders
  • nsIMsgCopyService.NotifyCompletion
  • nsIMsgFolder.deleteSubFolders
  • Removed API
  • Log4Moz
  • nsIAbListener
  • nsIMsgFolder.listFoldersWithFlags
  • nsIMsgFolderNotificationService.notifyItemElement()
  • Broken/Removed XUL Elements
  • <xul:grid>
  • Changes in commonly used Files
  • folderPane.js
  • MsgComposeCommands.js
  • chrome://messenger/content/newmailalert.xhtml
  • Low-level changes
  • Thunderbird is now multi-process (e10s)

Was this helpful?

Edit on GitHub
Export as PDF
  1. Add-on Development
  2. Add-on Update Guides
  3. Update for Thunderbird 91

Adapt to Changes in Thunderbird 79-91

PreviousUpdate for Thunderbird 91NextUpdate for Thunderbird 78

Last updated 8 months ago

Was this helpful?

This document tries to cover all the internal changes that may be needed to make Experiment add-ons compatible with Thunderbird 91. If you find changes which are not yet listed on this page, you can ask for help and advice in one of our .

Changed API

nsISimpleEnumerator, nsIArray and nsIMutableArray

Most usage of nsIArray and nsIMutableArray has been replaced by standard JavaScript arrays and functions which returned a nsISimpleEnumeratorhave been changed to return a JavaScript array as well. The following APIs have been updated (links to actual patches, showing how core handled the change):

  • (returns array)

  • (returns array)

  • nsIAbDirectory.getCardsFromProperty (returns array)

  • nsIAbManager.directories (returns array)\

  • (returns array)

  • (returns array)

  • (returns array)

  • (returns array)\

  • nsIMsgCompFields.attachments (returns array)\

  • (has been and now only accepts a single src folder)

  • (expects an array for the second argument)

  • nsIMsgFilterCustomAction.getCustomActions (returns array)

  • (expects an array for the first argument)

  • (expects an array for the first argument)

  • (returns array)

  • (expects an array for the first argument)

  • (expects an array for the first argument)

  • (expects an array for the first argument)

  • (expects an array for the first argument)

  • (returns array)\

  • (first parameter is an array)\

  • nsISmtpService.servers (returns array)

    \

fixIterator() & iteratorutils.jsm

The function fixIterator() is no longer needed by any core code and was subsequently removed together with iteratorutils.jsm. It was mostly used in the following way:

for (let account of fixIterator(MailServices.accounts.accounts)) {
  ...
}

Since MailServices.accounts.accounts or MailServices.accounts.allIdentities return a simple array since Thunderbird 75, there is no need to pipe it through fixIterator() anymore. If your add-on is multi-version compatible and still supports Thunderbird 68 this has to be dealt with separately.\

nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL

Renamed in Beta 80 to SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL. This is often used as the aSecurityFlags argument in calls to Services.io.newChannelFromURI().

nsIChannel newChannelFromURI(
   in nsIURI aURI,
   in Node aLoadingNode,
   in nsIPrincipal aLoadingPrincipal,
   in nsIPrincipal aTriggeringPrincipal,
   in unsigned long aSecurityFlags,
   in nsContentPolicyType aContentPolicyType);

nsILoadInfo.SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS

Renamed in Beta 80 to SEC_REQUIRE_SAME_ORIGIN_INHERITS_SEC_CONTEXT.

nsIMsgCompose.SendMsg

nsISocketTransportService.createTransport

Changed in Beta 87. Needs a fifth parameter to specify a nsIDNSRecord value, but can be null if not needed:

nsISocketTransport createTransport(in Array<ACString> aSocketTypes,
                                   in AUTF8String aHost,
                                   in long aPort,
                                   in nsIProxyInfo aProxyInfo,
                                   in nsIDNSRecord dnsRecord);

IOUtils.jsm

Renamed or Replaced API

nsIMsgCopyService.CopyFileMessage

Has been renamed to nsIMsgCopyService.copyFileMessage.

nsIMsgCopyService.CopyMessages

Has been renamed to nsIMsgCopyService.copyMessages.

nsIMsgCopyService.CopyFolders

Has been renamed to nsIMsgCopyService.copyFolder and no longer accepts an Array of src folders, but a single src folder.

nsIMsgCopyService.NotifyCompletion

Has been renamed to nsIMsgCopyService.notifyCompletion.

nsIMsgFolder.deleteSubFolders

Removed API

Log4Moz

The file Log4moz.jsm has been removed in Thunderbird 85. Instead, use console:

  • console.debug()

  • console.log()

  • console.trace() - same as console.log(), but dumps a trace log additionally.

  • console.info()

  • console.warn()

  • console.error()

These basic log functions accept multiple parameters, which are all dumped to the console. For example:

console.log("function XY executed", objectX, objectY);

Alternatively,console.createInstance() allows to define a custom console logger, with a prefix and a maxLogLevel. The maxLogLevel can be used to disable/enable logging in debug or production builds or set the level based on users choice.

var gLog = console.createInstance({
    prefix: "My great Add-on",
    maxLogLevel: "Warn", // Error, Warn, Info, Trace, Log, Debug
  });

gLog.info("This will not be logged, as maxLogLevel is set to 'Warn'");

The levels Info, Trace and Log are actually identical.

nsIAbListener

Interface has been dropped in favor of an observer based approach. See

nsIMsgFolder.listFoldersWithFlags

nsIMsgFolderNotificationService.notifyItemElement()

Broken/Removed XUL Elements

<xul:grid>

The grid element does not seem to work anymore. Alternative is to use <html:table>.

Changes in commonly used Files

folderPane.js

The ftvItem object has been renamed to FtvItem in Beta 86.

MsgComposeCommands.js

GetMsgAttachmentElement()

attachmentsCount()

Has been replaced by gAttachmentBucket.itemCount.

attachmentsSelectedCount()

Has been replaced by gAttachmentBucket.selectedCount.

chrome://messenger/content/newmailalert.xhtml

No longer supports the gAlertListener, gUserInitiated and gOrigin parameters when being opened (argument 1-3). Instead, the following parameters are are used now:

+  // arguments[0] --> The real nsIMsgFolder with new mail.
+  // arguments[1] --> The keys of new messages.
+  // arguments[2] --> The nsIObserver to receive window closed event

Low-level changes

Thunderbird is now multi-process (e10s)

Thunderbird can now separate content into different processes, which can only communicate through limited channels. This change has advantages relative to security and performance, but restricts code from freely accessing data that belongs to a different process.

In Thunderbird 91, this is primarily affecting pages belonging to an Add-on, like the background page or frames injected with an experiment. Most other parts of Thunderbird did not (yet!) change as much.

In practical terms, this means that you may need to update your experiments:

  • As a consequence, if you load JavaScript modules in "child" experiment code, you will now get separate instances of the JSM: each process has its own instance, and there could be multiple child processes. If you keep using JSMs from "child" code, you may furthermore need to manually unload these separate instances on API shutdown (ExtensionAPI.onShutdown), even if you use a catch-all unloading solution like CachingFix or the WindowListener API.

For example .\

Renamed in Beta 86 to nsIMsgCompose.sendMsg. It also returns a Promise now. More details can be found .\

See for more details.

The Thunderbird-specific file was removed without a direct replacement. You need to alter your logic or copy code from the old JSM into your add-on. might be a good inspiration, as it contains the changes that were necessary for core code.

Has been replaced by .

Use instead.

Use the dedicated function or instead.

Has been replaced bygAttachmentBucket. More information can be found .

If you create frames in Thunderbird's UI, these frames now need the appropriate attributes to load content in the right process. You can find an example of required changes in .

If you exchange raw objects between WebExtension scopes / "child" experiment code and Thunderbird / "parent" experiment code, you need to migrate to an indirect approach, usually based on explicit message passing. Depending on the complexity of your task, this can either happen through notifyTools, a custom experiment API or through custom experiment code directly using cross-process APIs (likely either or ).

here
here
here
IOUtils.jsm
Bug 1678109
nsIMsgFolder.deleteSelf
https://searchfox.org/comm-central/source/mail/base/content/msgHdrView.js#379-429
https://searchfox.org/comm-central/source/mail/base/content/msgHdrView.js#277
https://searchfox.org/comm-central/source/mail/base/content/msgHdrView.js#335
nsIMsgFolder.getFoldersWithFlags
MailServices.mfn.notifyMsgsJunkStatusChanged
MailServices.mfn.notifyFolderReindexTriggered
here
the E10S compatibility commit for the CustomUI experiment
message managers
actors
communication channels
nsIAbCard.properties
nsIAbDirectory.childCards
nsIMsgAccountManager.accounts
nsIMsgAccountManager.allFolders
nsIMsgAccountManager.allIdentities
nsIMsgAccountManager.allServers
nsIMsgCopyService.CopyFolders
nsIMsgCopyService.CopyMessages
nsIMsgFolder.addKeywordsToMessages
nsIMsgFolder.deleteMessages
nsIMsgFolder.listFoldersWithFlags
nsIMsgFolder.markMessagesRead
nsIMsgFolder.markMessagesFlagged
nsIMsgFolder.removeKeywordsFromMessages
nsIMsgFolder.setJunkScoreForMessages
nsIMsgFolder.subFolders
nsIMsgFolderListener.msgsClassified
renamed