management.getPermissionWarningsById()

When the user installs or upgrades an add-on, the browser may warn the user about any particularly powerful permissions that the add-on has requested. Not all permissions result in warnings, and this behavior is not standardized across browsers.

Given the ID of an add-on, this function returns the permission warnings for it as an array of strings.

This API requires the "management" API permission.

This is an asynchronous function that returns a Promise.

Syntax

js
let gettingWarnings = browser.management.getPermissionWarningsById(
  id                  // string
)

Parameters

id

string. ID of the add-on whose permission warnings you want to retrieve.

Return value

A Promise that will be fulfilled with an array of strings, each of which contains the text of a permission warning.

Examples

Log the permission warnings for the add-on whose ID is "my-add-on":

js
let id = "my-add-on";

function gotWarnings(warnings) {
  for (const warning of warnings) {
    console.log(warning);
  }
}

browser.management.getPermissionWarningsById(id).then(gotWarnings);

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
getPermissionWarningsById
Chrome – Full support
Chrome 58 (Release date: 2017-04-19)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 45 (Release date: 2017-05-10)
footnote Full support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

Note: This API is based on Chromium's chrome.management API. This documentation is derived from management.json in the Chromium code.