Movatterモバイル変換


[0]ホーム

URL:


  1. Mozilla
  2. Add-ons
  3. Browser extensions
  4. JavaScript APIs
  5. permissions
  6. permissions.getAll()

permissions.getAll()

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

This is an asynchronous function that returns aPromise.

Syntax

js
let gettingAll = browser.permissions.getAll()

Parameters

None.

Return value

APromise that will be fulfilled with apermissions.Permissions object containing all the permissions currently granted to the extension. This includes all permissions the extension has listed in thepermissions key, and any permissions listed inoptional_permissions that the extension has been granted by callingpermissions.request().

Examples

js
// Extension permissions are:// "webRequest", "tabs", "*://*.mozilla.org/*"const currentPermissions = await browser.permissions.getAll();console.log(currentPermissions.permissions); // [ "webRequest", "tabs" ]console.log(currentPermissions.origins); // [ "*://*.mozilla.org/*" ]

Example extensions

Browser compatibility

Note:This API is based on Chromium'schrome.permissions API.

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp