browserAction.setBadgeText()

Sets the badge text for the browser action. The badge is displayed on top of the icon.

Syntax

browser.browserAction.setBadgeText(
  details // object
)

Parameters

details
object.
text
string. Any number of characters can be passed, but only about four can fit in the space.
tabIdOptional
integer. Set the badge text only for the given tab.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?45.0Yes33
Firefox
Basic supportNo

Examples

Acknowledgements

This API is based on Chromium's chrome.browserAction API. This documentation is derived from browser_action.json in the Chromium code.

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,