browser.browserAction.setBadgeText({ text: "1234" });
browser.browserAction.setBadgeTextColor({ color: "red" });
browser.browserAction.onClicked.addListener(() => {
browser.browserAction.setBadgeTextColor({ color: "green" });
});browserAction.setBadgeTextColor() / notebook
browserAction.setBadgeTextColor()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
browser.browserAction.setBadgeText({ text: "1234" });
browser.browserAction.setBadgeTextColor({ color: "red" });
browser.browserAction.onClicked.addListener((tab) => {
browser.browserAction.setBadgeTextColor({
color: "green",
tabId: tab.id,
});
});