Wren

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

MemberResultStatusGate
setTitle(TitleDetails details)voidhost
getTitle(optional TabDetails details)stringhost
setPopup(PopupDetails details)voidhost
getPopup(optional TabDetails details)stringhost
setBadgeText(BadgeTextDetails details)voidhost
getBadgeText(optional TabDetails details)stringhost
setBadgeBackgroundColor(BadgeColorDetails details)voidhost
getBadgeBackgroundColor(optional TabDetails details)i64[]host
setBadgeTextColor(BadgeColorDetails details)voidhostAccepted; the badge's text keeps its colour.
setIcon(IconDetails details)voidhost
enable(optional i64 tabId)voidhostWith a tabId: accepted, and the button stays as it is.
disable(optional i64 tabId)voidhost
isEnabled(optional i64 tabId)boolhost
getUserSettings()UserSettingshost

Events

EventListener's parametersGate
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

PropertyType
tabId (optional)i64

TitleDetails

PropertyType
titlestring
tabId (optional)i64

PopupDetails

PropertyType
popupstringA file of the extension; "" : no popup (a click fires onClicked).
tabId (optional)i64

BadgeTextDetails

PropertyType
text (optional)stringThe button shows 4 characters; a text longer than 64 is cut.
tabId (optional)i64

BadgeColorDetails

PropertyType
colorColorArray
tabId (optional)i64

IconDetails

PropertyType
imageData (optional)anyNot shown yet: the icon stays the manifest's.
path (optional)IconPath
tabId (optional)i64

UserSettings

PropertyType
isOnToolbarbool

Edit this page on GitHub