Retrieve a
permissions.Permissions
object containing all the permissions currently granted to the extension.
This is an asynchronous function that returns a
Promise
.
var gettingAll = browser.permissions.getAll()
None.
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()
.
BCD tables only load in the browser
// Extension permissions are:
// "webRequest", "tabs", "*://*.mozilla.org/*"
浏览器
.
permissions
.
getAll
(
)
.
then
(
(
result
)
=>
{
console
.
log
(
result
.
permissions
)
;
// [ "webRequest", "tabs" ]
console
.
log
(
result
.
origins
)
// [ "*://*.mozilla.org/*" ]
}
)
;
注意:
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.
最后修改: , 由 MDN 贡献者