图标上的Google Chrome分机号码 [英] Google Chrome Extension Numbers on the Icon
问题描述
我一直在尝试使用Chrome扩展程序,并且我想要制作一个与Google语音扩展程序相似的图标,当我收到一个活动时,图标旁边会显示一个蓝色的1,这是否是一个整体图标?然后他们只使用setIcon方法?像这样
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:
gmail似乎全部达到500!他们不能为每个号码设置图标,或者他们?有什么我可以用它来做这件事吗?我已经有了我的图标,如果我必须制作一个独一无二的图标,我可以只制作10个图标,然后有一个10+图标。我将它连接到可能有很多事件的API。
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!
谢谢!
推荐答案
您可以设置 徽章
> setBadgeText :
You can set a badge on your browser action with setBadgeText
:
chrome.browserAction.setBadgeText({text: "10+"}); // We have 10+ unread items.
请注意,如果您传递的文本超过4个字符,它将被截断为前4个字符。
Note that if the text you pass is longer than 4 characters, it will be truncated to the first 4 characters.
这篇关于图标上的Google Chrome分机号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!