permissions API

Hint

The permissions API is inherited from Firefox, and its primary documentation is maintained by Mozilla at MDN. Thunderbird implements only the subset of functions, events, and types listed here. The MDN pages may provide further details and examples, but they may also reference features that are not supported in Thunderbird.

Functions

contains(permissions)

– [Added in TB 55]

Check if the extension has the given permissions.

Parameters

permissions

permissions

Return type (Promise)

_returns

boolean

getAll()

– [Added in TB 55]

Get a list of all the extension’s permissions.

Return type (Promise)

_returns

remove(permissions)

– [Added in TB 55]

Relinquish the given permissions.

Parameters

permissions

permissions

request(permissions)

– [Added in TB 55]

Request the given permissions.

Note

It’s not possible to request permissions from within DevTools (bug 1796933).

Note

Before version 101, permissions cannot be requested from a sidebar document (bug 1493396).

Note

Before version 75, permissions cannot be requested from popup panels (see bug 1432083).

Note

Before version 61, permissions cannot be requested from options pages embedded in about:addons (see bug 1382953).

Parameters

permissions

permissions

Return type (Promise)

_returns

boolean

Events

onAdded

– [Added in TB 77]

Fired when the extension acquires new permissions.

Parameters for onAdded.addListener(listener)

listener(permissions)

listener(permissions)

A function that will be called when this event occurs.

Parameters passed to the listener function

permissions

permissions

onRemoved

– [Added in TB 77]

Fired when permissions are removed from the extension.

Parameters for onRemoved.addListener(listener)

listener(permissions)

listener(permissions)

A function that will be called when this event occurs.

Parameters passed to the listener function

permissions

permissions

Types

AnyPermissions

object

data_collection

[data_collection]

(array of OptionalDataCollectionPermission, optional)

origins

[origins]

(array of MatchPattern, optional)

permissions

[permissions]

(array of Permission or OptionalOnlyPermission, optional)

CommonDataCollectionPermission

string

Supported values:

authenticationInfo

authenticationInfo

bookmarksInfo

bookmarksInfo

browsingActivity

browsingActivity

financialAndPaymentInfo

financialAndPaymentInfo

healthInfo

healthInfo

locationInfo

locationInfo

personalCommunications

personalCommunications

personallyIdentifyingInfo

personallyIdentifyingInfo

searchTerms

searchTerms

websiteActivity

websiteActivity

websiteContent

websiteContent

MatchPattern

string

Supported values:

<all_urls>

<all_urls>

or

or

MatchPatternRestricted

Same as MatchPattern above, but excludes <all_urls>

string

or

string

MatchPatternUnestricted

Mostly unrestricted match patterns for privileged add-ons. This should technically be rejected for unprivileged add-ons, but, reasons. The MatchPattern class will still refuse privileged schemes for those extensions.

string

OptionalDataCollectionPermission

or

string

Supported values:

technicalAndInteraction

technicalAndInteraction

OptionalOnlyPermission

string

No supported values.

OptionalPermission

or

string

Supported values:

accountsFolders

accountsFolders

– [Added in TB 68]

accountsIdentities

accountsIdentities

– [Added in TB 91]

accountsRead

accountsRead

– [Added in TB 66]

addressBooks

addressBooks

– [Added in TB 64]

browserSettings

browserSettings

browsingData

browsingData

clipboardRead

clipboardRead

clipboardWrite

clipboardWrite

compose

compose

– [Added in TB 74]

compose.save

compose.save

– [Added in TB 102]

compose.send

compose.send

– [Added in TB 90]

declarativeNetRequestFeedback

declarativeNetRequestFeedback

downloads

downloads

downloads.open

downloads.open

geolocation

geolocation

management

management

messagesDelete

messagesDelete

– [Added in TB 91]

messagesImport

messagesImport

– [Added in TB 106]

messagesModify

messagesModify

– [Added in TB 82]

messagesModifyPermanent

messagesModifyPermanent

– [Added in TB 123]

messagesMove

messagesMove

– [Added in TB 66]

messagesRead

messagesRead

– [Added in TB 66]

messagesTags

messagesTags

– [Added in TB 102]

messagesTagsList

messagesTagsList

– [Added in TB 122]

messagesUpdate

messagesUpdate

– [Added in TB 122]

messengerSettings

messengerSettings

– [Added in TB 137]

nativeMessaging

nativeMessaging

notifications

notifications

pkcs11

pkcs11

privacy

privacy

sensitiveDataUpload

sensitiveDataUpload

– [Added in TB 115]

sessions

sessions

– [Added in TB 140]

tabs

tabs

– [Added in TB 62]

webNavigation

webNavigation

OptionalPermissionNoPrompt

string

Supported values:

idle

idle

Permission

or

or

string

Supported values:

declarativeNetRequest

declarativeNetRequest

PermissionNoPrompt

or

or

string

Supported values:

alarms

alarms

contextualIdentities

contextualIdentities

declarativeNetRequestWithHostAccess

declarativeNetRequestWithHostAccess

dns

dns

identity

identity

menus

menus

– [Added in TB 77]

storage

storage

theme

theme

– [Added in TB 86]

unlimitedStorage

unlimitedStorage

PermissionPrivileged

string

Supported values:

mozillaAddons

mozillaAddons

Permissions

– [Added in TB 55]

object

data_collection

[data_collection]

(array of OptionalDataCollectionPermission, optional)

origins

[origins]

(array of MatchPattern, optional)

permissions

[permissions]

(array of OptionalPermission or OptionalOnlyPermission, optional)