# Supported WebExtension APIs

## Thunderbird WebExtension APIs

Thunderbird provides the following messenger related WebExtension APIs, which are sometimes referred to as MailExtension APIs.

| API                                                                                                 | Permission                                                                                                                                                                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [accounts](https://webextension-api.thunderbird.net/en/mv2/accounts.html)                           | accountsRead                                                                                                                                                                                      | Enables an extension to access information of accounts and identities configured in Thunderbird's account manager.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [addressBooks](https://webextension-api.thunderbird.net/en/mv2/addressBooks.html)                   | addressBooks                                                                                                                                                                                      | Enables an extension to access, modify, create and delete Thunderbird address books.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [browserAction](https://webextension-api.thunderbird.net/en/mv2/browserAction.html)                 |                                                                                                                                                                                                   | <p>Enables an extension to interact with a <a href="https://developer.thunderbird.net/add-ons/mailextensions/supported-ui-elements#browser-action">browser action button</a>.<br></p><p><em>Permission info:</em></p><ul><li>This API does not require a permission, but a <code>browser\_action</code> manifest key.</li></ul><p><strong>Note:</strong> This API has been renamed to action in <a href="https://webextension-api.thunderbird.net/en/mv3/action.html">Manifest V3</a>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [cloudFile](https://webextension-api.thunderbird.net/en/mv2/cloudFile.html)                         |                                                                                                                                                                                                   | <p>Enables an extension to register a cloudFile provider, which can be used to upload large attachments to a server, instead of attaching them directly to the email.</p><p><em>Permission info:</em></p><ul><li>This API does not require a permission, but a <code>cloudFile</code> manifest key.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [commands](https://webextension-api.thunderbird.net/en/mv2/commands.html)                           |                                                                                                                                                                                                   | <p>The commands API adds keyboard shortcuts that can trigger actions in an extension.<br><br><em>Permission info:</em></p><ul><li>This API does not require a permission, but a <code>commands</code> manifest key.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [compose](https://webextension-api.thunderbird.net/en/mv2/compose.html)                             | compose                                                                                                                                                                                           | Enables an extension to open a new message compose window or react to events while the message is being composed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [composeAction](https://webextension-api.thunderbird.net/en/mv2/composeAction.html)                 |                                                                                                                                                                                                   | <p>Enables an extension to interact with a <a href="https://developer.thunderbird.net/add-ons/mailextensions/supported-ui-elements#compose-action">compose action button</a>.</p><p><br><em>Permission info:</em></p><ul><li>This API does not require a permission, but a <code>compose\_action</code> manifest key.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [composeScripts](https://webextension-api.thunderbird.net/en/mv2/composeScripts.html)               | compose                                                                                                                                                                                           | Functionally is the same as the [contentScripts](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/contentScripts) API except that it works on the document of email messages during composition.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [contacts](https://webextension-api.thunderbird.net/en/mv2/contacts.html)                           | addressBooks                                                                                                                                                                                      | Enables an extension to access, modify, create and delete contacts in Thunderbird address books.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [folders](https://webextension-api.thunderbird.net/en/mv2/folders.html)                             | accountsFolders                                                                                                                                                                                   | Enables an extension to access, modify, create and delete mail account folders.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [mailingLists](https://webextension-api.thunderbird.net/en/mv2/mailingLists.html)                   | addressBooks                                                                                                                                                                                      | Enables an extension to access, modify, create and delete mailing lists in Thunderbird address books.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [mailTabs](https://webextension-api.thunderbird.net/en/mv2/mailTabs.html)                           | accountsFolders                                                                                                                                                                                   | <p>Enables an extension to interact with Thunderbird's main window.<br><br><em>Permission info:</em></p><ul><li>The <code>accountsFolders</code> permission is only needed to set the currently displayed folder.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [menus](https://webextension-api.thunderbird.net/en/mv2/menus.html)                                 | <p>menus,<br><a href="https://webextension-api.thunderbird.net/en/mv2/menus.html#overridecontext-contextoptions">menus.overrideContext</a>,</p><p>accountsRead, messagesRead,</p><p>activeTab</p> | <p>Enables an extension to add (context-) menu entries to Thunderbird menus.<br><br><em>Permission info:</em></p><ul><li>The <code>menus.overrideContext</code> permission is needed to <a href="https://webextension-api.thunderbird.net/en/mv2/menus.html#overridecontext-contextoptions">override a default menu entry</a>.</li><li>The <code>accountsRead</code> and <code>messagesRead</code> permissions are needed to populate the associated fields in the <a href="https://webextension-api.thunderbird.net/en/mv2/menus.html#onclickdata"><code>OnClickedData</code></a> object.</li><li>The <code>activeTab</code> permission is (currently) needed to get advanced information for the <code>onShown</code> event (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1664423">bug 1664423</a>)</li></ul>                                                                                                                                                                                                  |
| [messageDisplay](https://webextension-api.thunderbird.net/en/mv2/messageDisplay.html)               | messagesRead                                                                                                                                                                                      | Enables an extension to react on and interact with the currently displayed messages.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [messageDisplayAction](https://webextension-api.thunderbird.net/en/mv2/messageDisplayAction.html)   |                                                                                                                                                                                                   | <p>Enables an extension to interact with a <a href="https://developer.thunderbird.net/add-ons/mailextensions/supported-ui-elements#message-display-action">message display action button</a>.<br><br><em>Permission info:</em></p><ul><li>This API does not require a permission, but a <code>message\_display\_action</code> manifest key.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [messageDisplayScripts](https://webextension-api.thunderbird.net/en/mv2/messageDisplayScripts.html) | messagesModify                                                                                                                                                                                    | Functionally is the same as the [contentScripts](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/contentScripts) API except that it works on the document of email messages being displayed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [messages](https://webextension-api.thunderbird.net/en/mv2/messages.html)                           | <p>messagesRead,</p><p>messagesMove,<br>accountsRead</p>                                                                                                                                          | <p>Enables an extension to list, search, read, copy, move and delete messages.</p><p><br><em>Permission info:</em></p><ul><li>The <code>messagesRead</code> permission is needed to list, read, mark and tag messages.</li><li>The <code>messagesMove</code> permission is needed to copy, move and delete messages.</li><li>The <code>accountsRead</code> permission is needed by any function/event which involves folder information.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [tabs](https://webextension-api.thunderbird.net/en/mv2/tabs.html)                                   | tabs, activeTab, compose, messageModify                                                                                                                                                           | <p>Enables an extension to interact with Thunderbird's tab system. It allows to create, modify, and rearrange tabs and to communicate with scripts in tabs.<br><br><em>Permission info:</em></p><ul><li>The <code>tabs</code> or <code>activeTab</code> permission is only needed if the <code>url</code>, <code>favIconUrl</code> or <code>title</code> information of tabs are accessed. The <code>tab</code> permission will allow access to that information in all tabs, the <code>activeTab</code> permission restricts that to the active tab.<br>Note: The <code>activeTab</code> permission implies the <code>\<all\_urls></code> host permission for the active (web page -) tab.</li><li>The <code>compose</code> permissions is needed to call <code>tabs.executeScript()</code> and <code>tabs.insertCSS()</code> for compose tabs.</li><li>The <code>messageModify</code> permission is needed to call <code>tabs.executeScript()</code> and <code>tabs.insertCSS()</code> for a message display tab.</li></ul> |
| [theme](https://webextension-api.thunderbird.net/en/mv2/theme.html)                                 | theme                                                                                                                                                                                             | <p>The theme API can be used to create static or dynamic Thunderbird themes. Theme experiments are supported.</p><p><em>Permission info:</em></p><ul><li>The <code>theme</code> permission is needed to dynamically update the theme.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [windows](https://webextension-api.thunderbird.net/en/mv2/windows.html)                             | tabs                                                                                                                                                                                              | <p>Enables an extension to interact with Thunderbird's windows which can contain webpage tabs and also other window types like composer or address books that cannot contain webpage tabs. You can use this API to create, modify, and rearrange windows.</p><p><br><em>Permission info:</em></p><ul><li>The <code>tabs</code> permission is needed to populate the <code>url</code>, <code>favIconUrl</code> and <code>title</code> information in the <code>tabs</code> member of the <a href="https://webextension-api.thunderbird.net/en/mv2/windows.html#window"><code>Window</code></a> object.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                               |

You can find more information in the [Thunderbird WebExtensions API documentation ](https://webextension-api.thunderbird.net).

## Firefox WebExtension APIs

As Thunderbird is based on Firefox, many of its WebExtension APIs can be used in Thunderbird as well. The APIs listed in the following table are known to work with Thunderbird.

{% hint style="warning" %}
The following APIs link to their MDN description pages. Please be aware, that MDN is dedicated to web browsers (not limited to Firefox). Some information listed on MDN may not apply to Thunderbird and some API methods may not be supported. Each API page should include a compatibility chart and if that includes support for Firefox, it should work in Thunderbird as well.
{% endhint %}

| API                                                                                                           | Permission                                                                                                                                      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [browserSettings](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserSettings) | browserSettings                                                                                                                                 | Enables an extension to modify certain global browser settings. Because these are global settings, it's possible for extensions to conflict. See the documentation for [BrowserSetting.set()](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/types/BrowserSetting/set) for details of how conflicts are handled.                                                                                                                                                                                                                                                                                                                                                                                                             |
| [clipboard](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/clipboard)             | <p>clipboardWrite,</p><p>clipboardRead</p>                                                                                                      | <p>Enables an extension to copy items to the system clipboard. Currently the API only supports copying images, but it's intended to support copying text and HTML in the future.<br><br><em>Permission info:</em></p><ul><li>The <code>clipboardRead</code> permission is not used by this API but is listed here for completeness. To read from the clipboard, the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API">Clipboard Web API</a> has to be used and needs the <code>clipboardRead</code> permission.</li></ul>                                                                                                                                                                                            |
| [contentScripts](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/contentScripts)   |                                                                                                                                                 | <p>Use this API to register content scripts to instruct the browser to insert the given content scripts into pages that match the URL patterns specified during registration. In Thunderbird, content scripts can only be used in web pages loaded into tabs.<br><br><em>Permission info:</em></p><ul><li>This API does not require a dedicated permission, but an appropriate <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/permissions#Host_permissions">host permission</a> for any patterns it passes to <code>register()</code>.</li></ul>                                                                                                                                                          |
| [cookies](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies)                 | cookies                                                                                                                                         | <p>Enables an extension to get and set cookies, and be notified when they change.<br><br><em>Permission info:</em></p><ul><li>In addition to the <code>cookies</code> permission, this API also needs a <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/permissions#Host_permissions">host permissions</a> for the sites whose cookies are to be accessed. See <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/cookies#Permissions">cookie Permissions</a>.</li></ul>                                                                                                                                                                                                               |
| [dns](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/dns)                         | dns                                                                                                                                             | Enables an extension to resolve domain names.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [downloads](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/downloads)             | <p>downloads,</p><p>downloads.open</p>                                                                                                          | <p>Enables extensions to interact with the browser's download manager. You can use this API to <a href="https://thunderbird.topicbox.com/groups/addons/Td4979394bb2782c5-Me7445c7edfb7410f6d2973a2/save-as-the-email-send">save files to disk</a>.<br><br><em>Permission info:</em></p><ul><li>The <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/downloads/open">downloads.open</a> permission is needed to open the saved file with the systems default application.</li></ul>                                                                                                                                                                                                                       |
| [extension](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/extension)             |                                                                                                                                                 | Utilities related to an extension. Gets URLs to resources packages with an extension. Gets the [Window](https://developer.mozilla.org/en-US/docs/Web/API/Window) object for some of the extension's pages. Get the values for various settings.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [i18n](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n)                       |                                                                                                                                                 | Functions to internationalize an extension. It can be used to get localized strings from locale files packaged with an extension and to find out Thunderbird's current language.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [identity](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/identity)               | identity                                                                                                                                        | Use the identity API to get an [OAuth2](https://oauth.net/2/) authorization code or access token, which an extension can then use to access user data from a service that supports OAuth2 access (such as Google or Facebook).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [idle](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/idle)                       | idle                                                                                                                                            | Find out when the user's system is idle, locked, or active.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [privacy](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/privacy)                 | privacy                                                                                                                                         | Access and modify various privacy-related settings.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [management](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/management)           | management                                                                                                                                      | <p>Gets information about installed add-ons.<br><br><em>Permission info:</em></p><ul><li>The <code>management</code> permission is only needed to access information of other add-on.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [notifications](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/notifications)     | notifications                                                                                                                                   | Display notifications to the user, using the underlying operating system's notification mechanism.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [permissions](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/permissions)         |                                                                                                                                                 | Enables extensions to request extra permissions at runtime, after they have been installed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [pkcs11](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/pkcs11)                   | pkcs11                                                                                                                                          | Enables an extension to enumerate [PKCS #11](https://en.wikipedia.org/wiki/PKCS_11) security modules and to make them accessible as sources of keys and certificates.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [proxy](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/proxy)                     | proxy                                                                                                                                           | <p>Enables an extension to proxy web requests. Use the <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/proxy/onRequest"><code>proxy.onRequest</code></a> event listener to intercept web requests, and return an object that describes whether and how to proxy them.<br><br><em>Permission info:</em></p><ul><li>In addition to the <code>proxy</code> permission, this API also needs a <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/permissions#Host_permissions">host permissions</a> for the URLs of intercepted requests.</li></ul>                                                                                                                           |
| [runtime](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime)                 |                                                                                                                                                 | <p>This module provides information about the extension and the environment it's running in. It also provides messaging APIs to:</p><ul><li>communicate between different parts of the extension</li><li>communicate with other extensions</li><li>communicate with native applications</li></ul><p><em>Usage info:</em></p><ul><li>On macOS, Thunderbird looks for native messaging manifests in the per-user path <code>~~/Library/Mozilla/NativeMessagingHosts/</code> rather than <code>~~/Library/Application Support/Mozilla/NativeMessagingHosts/</code></li><li>On macOS, the global path for native messaging manifests is <code>/Library/Application Support/Mozilla/NativeMessagingHosts/</code> (the same as Firefox)</li></ul> |
| [storage](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage)                 | storage, [unlimitedStorage](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#Unlimited_storage) | Enables extensions to store and retrieve data, and listen for changes to stored items.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [userScripts](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/userScripts)         |                                                                                                                                                 | <p>Use this API to register user scripts, third-party scripts designed to manipulate webpages or provide new features. Registering a user script instructs the browser to attach the script to pages that match the URL patterns specified during registration. In Thunderbird, user scripts can only be used in web pages loaded into tabs.<br><br>This API offers similar capabilities to contentScripts but with features suited to handling third-party scripts.</p>                                                                                                                                                                                                                                                                    |
| [webNavigation](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webNavigation)     | webNavigation                                                                                                                                   | Add event listeners for the various stages of a navigation. A navigation consists of a frame in the browser transitioning from one URL to another, usually (but not always) in response to a user action like clicking a link.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [webRequest](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest)           | webRequest, webRequestBlocking                                                                                                                  | <p>Add event listeners for the various stages of making an HTTP request, which includes websocket requests on <code>ws\://</code> and <code>wss\://</code>. The event listener receives detailed information about the request and can modify or cancel the request.<br><br><em>Permission info:</em></p><ul><li>In addition to the <code>webRequest</code> permission, this API also needs the <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/permissions#Host_permissions">host permission</a> for the requested host.</li><li>To use the blocking feature, the extension must also have the <code>webRequestBlocking</code> API permission.</li></ul>                                                  |

You can find more information about these APIs in the [MDN WebExtension API documentation](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API).
