Disable chrome extension icon

I am developing a chrome extension that shows notifications.
I am showing notifications using these functions chrome.browserAction.setBadgeBackgroundColor

and chrome.browserAction.setBadgeText

It looks like this:

After the user has seen the notifications, I want to remove this icon.

I tried to make it transparent, but this was the result:

Can someone help me on how to remove the icon, or if there is another way that does what I want?

When writing blank text, the icon goes away.


source to share

2 answers

To remove the icon counter, just set the text to an empty string:

    'text': '' //an empty string displays nothing!




Remember, if you set the icon for a special contribution to disable the text for that:

chrome.tab.query({currentWindow: true, active: true}, function(tabs) {
    var tab = tabs[0];
        text: ''
        tabId: theTabId




All Articles