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