Comment on page
A Guide to Extensions
How to create extensions for Thunderbird.
An extension is a Thunderbird add-on, that provides additional functionality by adding new user interface elements, alter content, or perform background tasks.
The 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:
"name": "Hello World",
"description": "A basic Hello World extension!",
"author": "[Your Name Here]",
"id": "[email protected]",
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
3(since Thunderbird Beta 110). 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.
browser_specific_settings.geckomanifest 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
102.*). Usually not needed.
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
[email protected], 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:
Alternatively, you may use an UUID enclosed in curly braces, for example:
iconsmanifest 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.
<script type="module" src="background.js"></script>
options_uimanifest 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 MailExtensions can use are controlled by manifest keys, for example
actionin Manifest v3)
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
Information about required permissions can be found in the following document:
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 optional permissions, which can be managed by the user during runtime.
- 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.jsonfile by defining an implementation script and a schema file describing the interface:
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 Have full, unrestricted access to Thunderbird, and your computer permission.
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.
💬: API has a public announcement post 📝: API has a public interface discussion
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:
- 1.Announcing the idea and a first outline of the suggested API on discuss.thunderbird.net. 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.
- 4.Publishing a working implementation, so add-on developers can use it and provide feedback.
- 5.Adding a patch to the tracking bug and request review.