2010年1月25日 星期一

Cheome extensions browserAction

設定icon上面的文字
chrome.browserAction.setBadgeText(object details)
Sets the badge text for the browser action. The badge is displayed on top of the icon.
Parameters
details
object )



text
string )


Any number of characters can be passed, but only about four can fit in the space.
tabId
optional integer )


Limits the change to when a particular tab is selected. Automatically resets when the tab is closed.



設定icon上文字的顏色
chrome.browserAction.setIcon(object details)
Sets the background color for the badge.
Parameters
details
object )



color
array of integer )


An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is [255, 0, 0, 255].
tabId
optional integer )


Limits the change to when a particular tab is selected. Automatically resets when the tab is closed.



沒有留言: