addressBooks.provider API

The address book provider API first appeared in Thunderbird 90. It allows to add address books, which are not stored or cached by Thunderbird itself, but are handled completely by the extension. Address books created by the this API will forward all access requests to the WebExtension. Possible use cases:

  • implement a custom storage

  • implement search-only address books querying a remote server

So far, only the API for search-only address books is implemented.


This API will change in future releases of Thunderbird.



Read and modify your address books and contacts


Transfer sensitive user data (if access has been granted) to a remote server for further processing


The permission addressBooks is required to use messenger.addressBooks.provider.*.



Registering this listener will create and list a read-only address book in Thunderbird’s address book window, similar to LDAP address books. When selecting this address book, users will first see no contacts, but they can search for them, which will fire this event. Contacts returned by the listener callback will be displayed as contact cards in the address book. Several listeners can be registered, to create multiple address books.

The event also fires for each registered listener (for each created read-only address book), when users type something into the mail composer’s To: field, or into similar fields like the calendar meeting attendees field. Contacts returned by the listener callback will be added to the autocomplete results in the dropdown of that field.


messenger.addressBooks.provider.onSearchRequest.addListener(async (node, searchString, query) => {
    let response = await fetch("" + searchString);
    let json = await response.json();
    return {
        isCompleteResult: true,
        // Return an array of ContactProperties as results.
        results: => ({
}, {
    addressBookName: "ACME employees",
    isSecure: true,

Parameters for onSearchRequest.addListener(listener, parameters)

listener(node, searchString, query)

A function that will be called when this event occurs.



Descriptions for the address book created by registering this listener.


(string, optional)

The name of the created address book.


(string, optional)

The unique ID of the created address book. If several listeners have been added, the id allows to identify which address book initiated the search request. If not provided, a unique ID will be generated for you.


(boolean, optional)

Whether the address book search queries are using encrypted protocols like HTTPS.

Parameters passed to the listener function


(string, optional)

The search text that the user entered. Not available when invoked from the advanced address book search dialog.


(string, optional)

The boolean query expression corresponding to the search. Note: This parameter may change in future releases of Thunderbird.

Expected return value of the listener function





(array of ContactProperties)

Required permissions

  • addressBooks