Configures whether the action count for tabs is displayed as the extension action's badge text and provides a way for the action count to be incremented.
On this page
declarativeNetRequest.setExtensionActionOptions
Syntax
let count = browser.declarativeNetRequest.setExtensionActionOptions(
extensionActionOptions, // object
);
Parameters
-
extensionActionOptions
-
An object containing the configuration details for the action count for tabs.
displayActionCountAsBadgeText
Optional-
boolean
Whether to automatically display the action count for a page as the extension's badge text. This preference persists across sessions. tabUpdate
Optional-
object
. Details of how the tab's action count should be adjusted. See the tabUpdate section for more details.
Additional objects
tabUpdate
-
increment
-
number
The amount to increment the tab's action count by. Negative values decrement the count. -
tabId
-
number
The tab to update the action count for.
Return value
A Promise
that fulfills with no arguments. If the request fails, the promise is rejected with an error message.
Examples
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
setExtensionActionOptions |
88 | 88 | No | ? | 74 | 16.4 | ? | ? | No | ? | 16.4 | ? |
options |
88 | 88 | No | ? | 74 | preview | ? | ? | No | ? | No | ? |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/setExtensionActionOptions