Docs
Web API
chrome.action
# chrome.action
The toolbar button of an extension whose manifest has an action (src/page/ext_api.odin; the shell draws it: src/browser/ext_toolbar.odin). A value set with a tabId holds for that tab only, until it closes.
Gate: no permission; contexts: Background, Popup, Tab; the manifest has an action. Source: api/ext_action.widl.
# Methods and properties
Member Result Status Gate
setTitle(TitleDetails details)void host
getTitle(optional TabDetails details)string host
setPopup(PopupDetails details)void host
getPopup(optional TabDetails details)string host
setBadgeText(BadgeTextDetails details)void host
getBadgeText(optional TabDetails details)string host
setBadgeBackgroundColor(BadgeColorDetails details)void host
getBadgeBackgroundColor(optional TabDetails details)i64[] host
setBadgeTextColor(BadgeColorDetails details)void host Accepted; the badge's text keeps its colour.
setIcon(IconDetails details)void host
enable(optional i64 tabId)void host With a tabId: accepted, and the button stays as it is.
disable(optional i64 tabId)void host
isEnabled(optional i64 tabId)bool host
getUserSettings()UserSettings host
# Events
Event Listener's parameters Gate
onClickedTab tab
# Types
# ColorArray
A colour: "#rrggbb", "#rgb", or [r, g, b, a].
One of: string or i64[].
# IconPath
An icon file, or an object of files by size.
One of: string or object.
# TabDetails
Property Type
tabId (optional)i64
# TitleDetails
Property Type
titlestring
tabId (optional)i64
Property Type
popupstring A file of the extension; "" : no popup (a click fires onClicked).
tabId (optional)i64
# BadgeTextDetails
Property Type
text (optional)string The button shows 4 characters; a text longer than 64 is cut.
tabId (optional)i64
# BadgeColorDetails
# IconDetails
Property Type
imageData (optional)any Not shown yet: the icon stays the manifest's.
path (optional)IconPath
tabId (optional)i64
# UserSettings
Property Type
isOnToolbarbool
Previous Extension APIs of Wren
Next chrome.alarms
Edit this page on GitHub
On this page