permissions API

Functions

contains(permissions)

Check if the extension has the given permissions.

Parameters

permissions

Return type (Promise)

boolean

getAll()

Get a list of all the extension’s permissions.

Return type (Promise)

remove(permissions)

Relinquish the given permissions.

Parameters

permissions

request(permissions)

Request the given permissions.

Parameters

permissions

Return type (Promise)

boolean

Events

onAdded

Fired when the extension acquires new permissions.

Parameters for onAdded.addListener(listener)

listener(permissions)

A function that will be called when this event occurs.

Parameters passed to the listener function

permissions

onRemoved

Fired when permissions are removed from the extension.

Parameters for onRemoved.addListener(listener)

listener(permissions)

A function that will be called when this event occurs.

Parameters passed to the listener function

permissions

Types

AnyPermissions

object

[origins]

(array of permissions.MatchPattern, optional)

[permissions]

(array of permissions.Permission, optional)

Permissions

object

[origins]

(array of permissions.MatchPattern, optional)

[permissions]

(array of permissions.OptionalPermission, optional)