declarativeNetRequest.setExtensionActionOptions

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.

Syntax

js
let settingCount = 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
Opera
Safari
Firefox for Android
Safari on iOS
setExtensionActionOptions
Chrome – Full support
Chrome 88 (Release date: 2021-01-19)
footnote Full support
Edge – Full support
Edge 88 (Release date: 2021-01-21)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 74 (Release date: 2021-02-02)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
options
Chrome – Full support
Chrome 88 (Release date: 2021-01-19)
footnote Full support
Edge – Full support
Edge 88 (Release date: 2021-01-21)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 74 (Release date: 2021-02-02)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
options.tabUpdate
Chrome – Full support
Chrome 89 (Release date: 2021-03-02)
footnote Full support
Edge – Full support
Edge 89 (Release date: 2021-03-04)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 75 (Release date: 2021-03-24)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support

Legend

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

Full support
Full support
No support
No support