Google Chrome Extension Numbers on the Icon

You can set a badge on your browser action with setBadgeText:

chrome.browserAction.setBadgeText({text: "10+"}); // We have 10+ unread items.

Note that if the text you pass is longer than 4 characters, it will be truncated to the first 4 characters.

Edit: Mar 2021

According to the new Manifest V3, the APIs have been changed. According to the document:
In Manifest V3 the chrome.browserAction and chrome.pageAction APIs are consolidated into a single chrome.action API.

So, your code for adhering to the new API shall be:

chrome.action.setBadgeText({text: "10+"}); // We have 10+ unread items.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)