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.

4文字以内推奨で数字意外も表示出来ます。

backgroundからbrowserActionのbadge関連を利用して。

var num = 3;
chrome.browserAction.setBadgeBackgroundColor({color :’#ff0000′});
chrome.browserAction.setBadgeText({text:String(num)});

こんな感じになりました。

This entry was posted on 水曜日, 7月 25th, 2012 at 10:38 PM and is filed under Chrome Extention. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Unityによるゲームを公開しております iOS/Android
https://itunes.apple.com/jp/app/lost-knight-3d-action/id900917032
https://play.google.com/store/apps/details?id=com.groundroad.runknight

各種開発支援・機能開発等小さいお仕事などもお請けしております。
unity開発支援, PHPシステム開発, javascript/html5 フロント開発, titanium mobileアプリ開発
お気軽にお問い合わせください
大崎・五反田近郊での対面でのお打ち合わせはいつでも可能です。