sidebarAction

Gets and sets properties of an extension's sidebar.

A sidebar is a pane that is displayed at the left-hand or right-hand side of the browser window, next to the web page. The browser provides a UI that enables the user to see the currently available sidebars and to select a sidebar to display. Using the sidebar_action manifest.json key, an extension can define its own sidebar. Using the sidebarAction API described here, an extension can get and set the sidebar's properties.

The sidebarAction API is closely modeled on the browserAction API.

The sidebarAction API is based on Opera's sidebarAction API. However, note that the following are not yet supported: setBadgeText(), getBadgeText(), setBadgeBackgroundColor(), getBadgeBackgroundColor(), onFocus, onBlur.

Types

sidebarAction.ImageDataType
Pixel data for an image. Must be an ImageData object (for example, from a <canvas> element).

Functions

sidebarAction.close()
Closes the sidebar.
sidebarAction.getPanel()
Gets the sidebar's panel.
sidebarAction.getTitle()
Gets the sidebar's title.
sidebarAction.isOpen()
Checks whether the sidebar is open or not.
sidebarAction.open()
Opens the sidebar.
sidebarAction.setIcon()
Sets the sidebar's icon.
sidebarAction.setPanel()
Sets the sidebar's panel.
sidebarAction.setTitle()
Sets the sidebar's title. This will be displayed in any UI provided by the browser to list sidebars, such as a menu.
sidebarAction.toggle()
Toggles the visibility of the sidebar.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxOperaSafariFirefox for Android
ImageDataTypeChrome No support NoEdge No support NoFirefox Full support 54Opera Full support 30Safari No support NoFirefox Android No support No
closeChrome No support NoEdge No support NoFirefox Full support 57Opera No support NoSafari No support NoFirefox Android No support No
getBadgeBackgroundColorChrome No support NoEdge No support NoFirefox No support NoOpera Full support 30Safari No support NoFirefox Android No support No
getBadgeTextChrome No support NoEdge No support NoFirefox No support NoOpera Full support 30Safari No support NoFirefox Android No support No
getPanelChrome No support NoEdge No support NoFirefox Full support 54Opera Full support 30Safari No support NoFirefox Android No support No
getTitleChrome No support NoEdge No support NoFirefox Full support 54Opera Full support 30Safari No support NoFirefox Android No support No
isOpenChrome No support NoEdge No support NoFirefox Full support 59Opera No support NoSafari No support NoFirefox Android No support No
onBlurChrome No support NoEdge No support NoFirefox No support NoOpera Full support 30Safari No support NoFirefox Android No support No
onFocusChrome No support NoEdge No support NoFirefox No support NoOpera Full support 30Safari No support NoFirefox Android No support No
openChrome No support NoEdge No support NoFirefox Full support 57Opera No support NoSafari No support NoFirefox Android No support No
setBadgeBackgroundColorChrome No support NoEdge No support NoFirefox No support NoOpera Full support 30Safari No support NoFirefox Android No support No
setBadgeTextChrome No support NoEdge No support NoFirefox No support NoOpera Full support 30Safari No support NoFirefox Android No support No
setIconChrome No support NoEdge No support NoFirefox Full support 54Opera Full support 30Safari No support NoFirefox Android No support No
setPanelChrome No support NoEdge No support NoFirefox Full support 54Opera Full support 30Safari No support NoFirefox Android No support No
setTitleChrome No support NoEdge No support NoFirefox Full support 54Opera Full support 30Safari No support NoFirefox Android No support No
toggleChrome No support NoEdge No support NoFirefox Full support 73Opera No support NoSafari No support NoFirefox Android No support No

Legend

Full support  
Full support
No support  
No support

Example add-ons

Acknowledgements

This API is based on Opera's chrome.sidebarAction API.

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.