Last updated
Last updated
An extension is a Thunderbird add-on, that provides additional functionality by adding new user interface elements, alter content, or perform background tasks.
manifest.json
fileThe main configuration file of an extension is called manifest.json
, also referred to as the manifest. Besides defining some of the extension's basic properties like name, description and ID, it also defines how the extension hooks into Thunderbird:
A list of all manifest keys supported by Thunderbird can be found in the following document:
The following manifest keys define basic properties:
manifest_version
: A mandatory key defining the Manifest version used by the extension. Supported versions are 2
and 3
(since Thunderbird 128). The Manifest defines the basic rules how a WebExtension needs to be crafted and how it can interact with Thunderbird.
name
: A mandatory key to set the name of the extension.
version
: A mandatory key to define a number that denotes the version of the extension.
description
: A brief description of what the extension does.
author
: The name of a person or company representing the extension developer.
The browser_specific_settings.gecko
manifest key defines the following properties:
strict_min_version
: Defines the lowest targeted version of Thunderbird.
strict_max_version
: Defines the highest targeted version of Thunderbird. It can be set to a specific version or a broader match to limit it to a branch (for example 128.*
). Usually only needed if Experiments are included.
id
: The id serves as a unique identifier for the extension and is mandatory in order upload an extension to ATN or to be able to install it from an XPI file.
Best practice is to use an "email-address-style" id (but not a real email address) on a domain you control, for example name-of-your-addon@example.com
, if you own example.com
. As the id of your add-on cannot be changed once it is published, it is highly recommended to use a domain that you plan to keep for the forseeable future. If you don't have a domain to use, feel free to use:
<atn-user-name>.<add-on-name>@addons.thunderbird.net
\
Alternatively, you may use an UUID enclosed in curly braces, for example:
{e4aa2097-8ee9-49a4-9ec7-c633b1e8dfda}
The icons
manifest key tells Thunderbird the location of icons, which should be used to represent the MailExtension. Thunderbird supports basic image types like PNG files, but also SVG files. Thunderbird uses different file icon sizes in different places and allows registering a dedicated file for each size. The MailExtension will use the standard puzzle icon, if no icons have been defined.
The extension's background page is loaded in a hidden window when the add-on is started and can be used to load additional JavaScript files.
The background page specifies the JavaScript files to be loaded:
Instead of defining a background page, the extension can specify a simple list of JavaScript files. This will auto-generate a background page and then load the JavaScript files.
The options_ui
manifest key defines the standard MailExtension options page. The defined page will be displayed in the add-on manager by default.
The appearance of the options page can be configured as follows:
open_in_tab
: Open the options page in a tab instead of inline in the add-on manager.
browser_style
: Use default browser styles for the options page (recommended).
An inline options page may look as follows:
Some UI elements Thunderbird WebExtensions can use are controlled by manifest keys, for example
browser_action
(renamed to action
in Manifest v3)
compose_action
message_display_action
Further information about these UI elements can be found in the following document:
A core principle of the WebExtension technology is the use of permissions, so users can see which areas of Thunderbird an add-on wants to access. Add-on developers can predefine all requested permissions in the permissions
manifest key:
Information about required permissions can be found in the following document:
All JavaScript files loaded by an extension have access to:
Standard JavaScript methods
WebExtension APIs (see restrictions for content scripts and cloudFile scripts below)
A list of all WebExtension APIs supported by Thunderbird can be found in the following document:
The currently available WebExtension APIs are not yet sufficient, as some areas of Thunderbird are not accessible through these APIs. We are working on improving the situation.
Currently and for the foreseeable future Thunderbird supports Experiment APIs (a.k.a. Experiments), which are WebExtension APIs that are bundled and shipped together with a MailExtension. They interact directly with Thunderbird's internal APIs and allow add-ons to use additional features not yet available via built-in WebExtension APIs.
These additional APIs can be registered in the manifest.json
file by defining an implementation script and a schema file describing the interface:
The use of optional permissions is not supported for the same reason.
If you'd like to learn more about experiments, check out this detailed introduction:
Developers can share and re-use Experiments, if their add-ons have similar needs. Before starting to work on your own Experiment, check if any of the following APIs could already provide the functionality you need. Using them and providing feedback to their developers will help to improve these APIs.
Creating a good WebExtension API for Thunderbird is not an easy task. New APIs need to be generic and distinct from other APIs. Their interfaces have to be designed with foresight as we should avoid scenarios, where we have to make backward incompatible changes later because we have missed something.
If you want to propose and maybe collaborate on a new API, the following process is suggested:
Publishing a working implementation, so add-on developers can use it and provide feedback.
Adding a patch to the tracking bug and request review.
The name
and the description
of the shown example are only in English. explains how to use the WebExtension i18n API to localize these keys.
The type
attribute in the shown script
tag of background.js
defines it as a top level module and enables it to use modern .
The optional type
property in the shown background
definition loads all specified scripts as modules, allowing all of them to use .
For most permissions, the user must either accept all of the requested permissions during add-on install, or abort the install. Some permissions however can be requested as , which can be managed by the user during runtime.
(if the browser compatibility chart lists Firefox, the API also works in Thunderbird)
Content scripts (including and ) can only use the following WebExtension APIs:
.*
Content scripts can using runtime messaging, and thereby can indirectly access the WebExtension APIs. See our .
A script loaded from a CloudFile can only use the following WebExtension APIs:
.*
.*
.*
.*
.*
CloudFile management scripts can using runtime messaging, and thereby can indirectly access the WebExtension APIs.
Experiment APIs have full access to Thunderbird's core functions and can bypass the WebExtension permission system entirely. Including one or more Experiment APIs will therefore disable the individual permission prompt and instead prompt the user only for the permission.
If you have created an Experiment API which you think could be beneficial to other developers, please , so we can include it here.
Announcing the idea and a first outline of the suggested API on . An actual implementation is not yet needed, but a general concept of how the API is supposed to work is helpful. This allows the add-on developer community to provide feedback and to make sure the design will cover their needs as well.
Publishing a detailed API description, which can be viewed and commented. Google docs have worked quite well (see and ), but any platform that allows to collaborate will be sufficient. The goal is to shape out the event, function and type definitions of the API.
Creating a , referencing the API description, so the core development team is notified and can comment as well.
Draft for calendar-related APIs in Thunderbird.
Adds missing functionality to add headers to a newly composed message.
Note: Adding X-
headers is supported by the compose API since Thunderbird 102.
A generic UI extension framework based on iframes registered at fixed extension points. Note: Does not yet fully support Thunderbird Supernova
An API to access files in the users profile folder. Until Mozilla has made a final decision about including the Chrome FileSystem API, this API can be used as an interim solution.
Load custom CSS files into Thunderbird windows.
Access Thunderbird system preferences.
Show notifications inside Thunderbird.
Permit WebExtensions to perform (time-limited) cleanup tasks after the add-on is disabled or uninstalled.
TCP support based on ArrayBuffers (currently client side only).
How to create extensions for Thunderbird.