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
.
sidebarAction.ImageDataType
ImageData
object (for example, from a <canvas>
element).sidebarAction.close()
sidebarAction.getPanel()
sidebarAction.getTitle()
sidebarAction.isOpen()
sidebarAction.open()
sidebarAction.setIcon()
sidebarAction.setPanel()
sidebarAction.setTitle()
sidebarAction.toggle()
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
ImageDataType |
No |
No |
54 |
? |
30 |
No |
? |
? |
No |
? |
? |
? |
close |
No |
No |
57 |
? |
No |
No |
? |
? |
No |
? |
? |
? |
getBadgeBackgroundColor |
No |
No |
No |
? |
30 |
No |
? |
? |
No |
? |
? |
? |
getBadgeText |
No |
No |
No |
? |
30 |
No |
? |
? |
No |
? |
? |
? |
getPanel |
No |
No |
54 |
? |
30 |
No |
? |
? |
No |
? |
? |
? |
getTitle |
No |
No |
54 |
? |
30 |
No |
? |
? |
No |
? |
? |
? |
isOpen |
No |
No |
59 |
? |
No |
No |
? |
? |
No |
? |
? |
? |
onBlur |
No |
No |
No |
? |
30 |
No |
? |
? |
No |
? |
? |
? |
onFocus |
No |
No |
No |
? |
30 |
No |
? |
? |
No |
? |
? |
? |
open |
No |
No |
57 |
? |
No |
No |
? |
? |
No |
? |
? |
? |
setBadgeBackgroundColor |
No |
No |
No |
? |
30 |
No |
? |
? |
No |
? |
? |
? |
setBadgeText |
No |
No |
No |
? |
30 |
No |
? |
? |
No |
? |
? |
? |
setIcon |
No |
No |
54 |
? |
30 |
No |
? |
? |
No |
? |
? |
? |
setPanel |
No |
No |
54 |
? |
30 |
No |
? |
? |
No |
? |
? |
? |
setTitle |
No |
No |
54 |
? |
30 |
No |
? |
? |
No |
? |
? |
? |
toggle |
No |
No |
73 |
? |
No |
No |
? |
? |
No |
? |
? |
? |
Note: 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.
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/sidebarAction