badgeを表示 | chrome extension
desktop notificationも良いけど。バッヂでかなりアピールできるので
http://code.google.com/chrome/extensions/browserAction.html
Badge
Browser actions can optionally display a badge — a bit of text that is layered over the icon. Badges make it easy to update the browser action to display a small amount of information about the state of the extension.
Because the badge has limited space, it should have 4 characters or less.
Set the text and color of the badge using setBadgeText() and setBadgeBackgroundColor(), respectively.
Browser actions can optionally display a badge — a bit of text that is layered over the icon. Badges make it easy to update the browser action to display a small amount of information about the state of the extension.
Because the badge has limited space, it should have 4 characters or less.
Set the text and color of the badge using setBadgeText() and setBadgeBackgroundColor(), respectively.
4文字以内推奨で数字意外も表示出来ます。
backgroundからbrowserActionのbadge関連を利用して。
var num = 3;
chrome.browserAction.setBadgeBackgroundColor({color :’#ff0000′});
chrome.browserAction.setBadgeText({text:String(num)});
chrome.browserAction.setBadgeBackgroundColor({color :’#ff0000′});
chrome.browserAction.setBadgeText({text:String(num)});
こんな感じになりました。