.. rst-class:: api-main-section
.. api-section-annotation-hack::
Check if the extension has the given permissions.
.. api-header:: :label: Parameters .. api-member:: :name: ``permissions`` :type: (:ref:`permissions.AnyPermissions`)
.. api-header:: :label: Return type (`Promise`_) .. api-member:: :type: boolean .. _Promise: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
.. api-section-annotation-hack::
Get a list of all the extension's permissions.
.. api-header:: :label: Return type (`Promise`_) .. api-member:: :type: :ref:`permissions.AnyPermissions` .. _Promise: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
.. api-section-annotation-hack::
Relinquish the given permissions.
.. api-header:: :label: Parameters .. api-member:: :name: ``permissions`` :type: (:ref:`permissions.Permissions`)
.. api-section-annotation-hack::
Request the given permissions.
.. api-header:: :label: Parameters .. api-member:: :name: ``permissions`` :type: (:ref:`permissions.Permissions`)
.. api-header:: :label: Return type (`Promise`_) .. api-member:: :type: boolean .. _Promise: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
.. rst-class:: api-main-section
.. api-section-annotation-hack::
Fired when the extension acquires new permissions.
.. api-header:: :label: Parameters for onAdded.addListener(listener) .. api-member:: :name: ``listener(permissions)`` A function that will be called when this event occurs.
.. api-header:: :label: Parameters passed to the listener function .. api-member:: :name: ``permissions`` :type: (:ref:`permissions.Permissions`)
.. api-section-annotation-hack::
Fired when permissions are removed from the extension.
.. api-header:: :label: Parameters for onRemoved.addListener(listener) .. api-member:: :name: ``listener(permissions)`` A function that will be called when this event occurs.
.. api-header:: :label: Parameters passed to the listener function .. api-member:: :name: ``permissions`` :type: (:ref:`permissions.Permissions`)
.. rst-class:: api-main-section
.. api-section-annotation-hack::
.. api-header:: :label: object .. api-member:: :name: [``origins``] :type: (array of :ref:`permissions.MatchPattern`, optional) .. api-member:: :name: [``permissions``] :type: (array of :ref:`permissions.Permission`, optional)
.. api-section-annotation-hack::
.. api-header:: :label: object .. api-member:: :name: [``origins``] :type: (array of :ref:`permissions.MatchPattern`, optional) .. api-member:: :name: [``permissions``] :type: (array of :ref:`permissions.OptionalPermission`, optional)