Наши волонтёры ещё не перевели данную статью на Русский. Присоединяйтесь к нам и помогите сделать эту работу!
Вы можете также прочитать эту статью на English (US).

Retrieve a permissions.Permissions object containing all the permissions currently granted to the extension.

This is an asynchronous function that returns a Promise.

Syntax

var gettingAll = browser.permissions.getAll()

Parameters

None.

Return value

A Promise that will be fulfilled with a permissions.Permissions object containing all the permissions currently granted to the extension. This includes all permissions the extension has listed in the permissions key, and any permissions listed in optional_permissions that the extension has been granted by calling permissions.request().

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxOperaFirefox for Android
getAllChrome Full support YesEdge No support NoFirefox Full support 55Opera Full support YesFirefox Android Full support 55

Legend

Full support  
Full support
No support  
No support

Examples

// Extension permissions are:
// "webRequest", "tabs", "*://*.mozilla.org/*"

browser.permissions.getAll().then((result) => {
  console.log(result.permissions); // [ "webRequest", "tabs" ]
  console.log(result.origins)      // [ "*://*.mozilla.org/*" ]
});

Example extensions

Acknowledgements

This API is based on Chromium's chrome.permissions API.

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.

Метки документа и участники

Внесли вклад в эту страницу: mdnwebdocs-bot, wbamberg, andrewtruongmoz
Обновлялась последний раз: mdnwebdocs-bot,