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
  • Thunderbird WebExtension APIs
  • Firefox WebExtension APIs

Was this helpful?

Edit on GitHub
Export as PDF
  1. Add-on Development
  2. A Guide to Extensions

Supported WebExtension APIs

Descriptions of all WebExtension API supported by Thunderbird.

Thunderbird WebExtension APIs

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

API
Permission
Description

accountsRead

Enables an extension to access information of accounts and identities configured in Thunderbird's account manager.

addressBooks

Enables an extension to access, modify, create and delete Thunderbird address books.

Permission info:

  • This API does not require a permission, but a browser_action manifest key.

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.

Permission info:

  • This API does not require a permission, but a cloudFile manifest key.

The commands API adds keyboard shortcuts that can trigger actions in an extension. Permission info:

  • This API does not require a permission, but a commands manifest key.

compose

Enables an extension to open a new message compose window or react to events while the message is being composed.

Permission info:

  • This API does not require a permission, but a compose_action manifest key.

compose

addressBooks

Enables an extension to access, modify, create and delete contacts in Thunderbird address books.

accountsFolders

Enables an extension to access, modify, create and delete mail account folders.

addressBooks

Enables an extension to access, modify, create and delete mailing lists in Thunderbird address books.

accountsFolders

Enables an extension to interact with Thunderbird's main window. Permission info:

  • The accountsFolders permission is only needed to set the currently displayed folder.

accountsRead, messagesRead,

activeTab

Enables an extension to add (context-) menu entries to Thunderbird menus. Permission info:

messagesRead

Enables an extension to react on and interact with the currently displayed messages.

  • This API does not require a permission, but a message_display_action manifest key.

messagesModify

messagesRead,

messagesMove, accountsRead

Enables an extension to list, search, read, copy, move and delete messages.

Permission info:

  • The messagesRead permission is needed to list, read, mark and tag messages.

  • The messagesMove permission is needed to copy, move and delete messages.

  • The accountsRead permission is needed by any function/event which involves folder information.

tabs, activeTab, compose, messageModify

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. Permission info:

  • The tabs or activeTab permission is only needed if the url, favIconUrl or title information of tabs are accessed. The tab permission will allow access to that information in all tabs, the activeTab permission restricts that to the active tab. Note: The activeTab permission implies the <all_urls> host permission for the active (web page -) tab.

  • The compose permissions is needed to call tabs.executeScript() and tabs.insertCSS() for compose tabs.

  • The messageModify permission is needed to call tabs.executeScript() and tabs.insertCSS() for a message display tab.

theme

The theme API can be used to create static or dynamic Thunderbird themes. Theme experiments are supported.

Permission info:

  • The theme permission is needed to dynamically update the theme.

tabs

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.

Permission info:

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.

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.

API
Permission
Description

browserSettings

clipboardWrite,

clipboardRead

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. Permission info:

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. Permission info:

cookies

Enables an extension to get and set cookies, and be notified when they change. Permission info:

dns

Enables an extension to resolve domain names.

downloads,

downloads.open

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

idle

Find out when the user's system is idle, locked, or active.

privacy

Access and modify various privacy-related settings.

management

Gets information about installed add-ons. Permission info:

  • The management permission is only needed to access information of other add-on.

notifications

Display notifications to the user, using the underlying operating system's notification mechanism.

Enables extensions to request extra permissions at runtime, after they have been installed.

pkcs11

proxy

This module provides information about the extension and the environment it's running in. It also provides messaging APIs to:

  • communicate between different parts of the extension

  • communicate with other extensions

  • communicate with native applications

Usage info:

  • On macOS, Thunderbird looks for native messaging manifests in the per-user path ~/Library/Mozilla/NativeMessagingHosts/ rather than ~/Library/Application Support/Mozilla/NativeMessagingHosts/

  • On macOS, the global path for native messaging manifests is /Library/Application Support/Mozilla/NativeMessagingHosts/ (the same as Firefox)

Enables extensions to store and retrieve data, and listen for changes to stored items.

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. This API offers similar capabilities to contentScripts but with features suited to handling third-party scripts.

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, webRequestBlocking

Add event listeners for the various stages of making an HTTP request, which includes websocket requests on ws:// and wss://. The event listener receives detailed information about the request and can modify or cancel the request. Permission info:

  • To use the blocking feature, the extension must also have the webRequestBlocking API permission.

PreviousSupported UI ElementsNextIntroducing Experiments

Last updated 2 months ago

Was this helpful?

Enables an extension to interact with a .

Note: This API has been renamed to action in .

Enables an extension to interact with a .

Functionally is the same as the API except that it works on the document of email messages during composition.

menus, ,

The menus.overrideContext permission is needed to .

The accountsRead and messagesRead permissions are needed to populate the associated fields in the object.

The activeTab permission is (currently) needed to get advanced information for the onShown event (see )

Enables an extension to interact with a . Permission info:

Functionally is the same as the API except that it works on the document of email messages being displayed.

The tabs permission is needed to populate the url, favIconUrl and title information in the tabs member of the object.

You can find more information in the .

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 for details of how conflicts are handled.

The clipboardRead permission is not used by this API but is listed here for completeness. To read from the clipboard, the has to be used and needs the clipboardRead permission.

This API does not require a dedicated permission, but an appropriate for any patterns it passes to register().

In addition to the cookies permission, this API also needs a for the sites whose cookies are to be accessed. See .

Enables extensions to interact with the browser's download manager. You can use this API to . Permission info:

The permission is needed to open the saved file with the systems default application.

Utilities related to an extension. Gets URLs to resources packages with an extension. Gets the object for some of the extension's pages. Get the values for various settings.

Use the identity API to get an 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).

Enables an extension to enumerate security modules and to make them accessible as sources of keys and certificates.

Enables an extension to proxy web requests. Use the event listener to intercept web requests, and return an object that describes whether and how to proxy them. Permission info:

In addition to the proxy permission, this API also needs a for the URLs of intercepted requests.

storage,

In addition to the webRequest permission, this API also needs the for the requested host.

You can find more information about these APIs in the .

Thunderbird WebExtensions API documentation
MDN WebExtension API documentation
accounts
addressBooks
browserAction
browser action button
Manifest V3
cloudFile
commands
compose
composeAction
compose action button
composeScripts
contentScripts
contacts
folders
mailingLists
mailTabs
menus
menus.overrideContext
override a default menu entry
OnClickedData
bug 1664423
messageDisplay
messageDisplayAction
message display action button
messageDisplayScripts
contentScripts
messages
tabs
theme
windows
Window
browserSettings
BrowserSetting.set()
clipboard
Clipboard Web API
contentScripts
host permission
cookies
host permissions
cookie Permissions
dns
downloads
save files to disk
downloads.open
extension
Window
i18n
identity
OAuth2
idle
privacy
management
notifications
permissions
pkcs11
PKCS #11
proxy
proxy.onRequest
host permissions
runtime
storage
unlimitedStorage
userScripts
webNavigation
webRequest
host permission