contacts¶
The address books API, also including the addressBooks and mailingLists namespaces, first appeared in Thunderbird 64. The quickSearch function was added in Thunderbird 68.
The Address Books sample extension uses this API.
Permissions¶
Functions¶
list(parentId)¶
Gets all the contacts in the address book with the id parentId.
parentIdquickSearch([parentId], searchString)¶
Gets all contacts matching searchString in the address book with the id parentId.
parentId]searchStringget(id)¶
create(parentId, [id], properties)¶
Adds a new contact to the address book with the id parentId.
parentIdid]update(id, properties)¶
Edits the properties of a contact. To remove a property, specify it as null.
delete(id)¶
Removes a contact from the address book. The contact is also removed from any mailing lists it is a member of.
idEvents¶
onCreated(node, id)¶
Fired when a contact is created.
onUpdated(node)¶
Fired when a contact is changed.
onDeleted(parentId, id)¶
Fired when a contact is removed from an address book.
parentIdidTypes¶
ContactNode¶
A node representing a contact in an address book.
idcontact.parentId]id of the parent object.readOnly]ContactProperties¶
A set of properties for a particular contact. For a complete list of properties that Thunderbird uses, see https://hg.mozilla.org/comm-central/file/tip/mailnews/addrbook/public/nsIAbCard.idl
It is also possible to store custom properties. The custom property name however may only use a to z, A to Z, 1 to 9 and underscores.