I've been experimenting with a Chrome Extension, and I want to make one similar to my Google Voice Extension where the icon shows a little blue "1" next to the icon when I receive an event, Is this a whole separate icon? and then they just use the "setIcon" method? Like this
chrome.browserAction.setIcon({path:"icon.png"});
Here's a visual example of how it looks:
The gmail one seems to go all the up to 500! They can't have an icon for each number, or do they?? Is there something I can use thats made to do this stuff? I already have my icon, if I have to make a unique one I may just make like 10 and then have a "10+" icon. I am connecting it to an API which could have a lot of events.
Has anybody had this issue? How did they get around it?
Any advice or suggestions would help!
Thanks!
Sometimes downloads are suspended because Chrome has deemed the website "suspicious." These suspended downloads are listed as not complete so a number will pop up on the icon showing how many downloads are not complete.
Notice that there is an orange "1" at the top right of the Google Play app icon. This indicates an update is available, but as Samuel mentions, the Google Play update notification is stuck. To clear the badge: Locate the Google Play icon on your phone.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With