Наши волонтёры ещё не перевели данную статью на Русский. Присоединяйтесь к нам и помогите сделать эту работу!
Вы можете также прочитать эту статью на English (US).

Sets the sidebar's panel: that is, the HTML document that defines the content of this sidebar.

Types of panel

Sidebars always have a "manifest panel", which is the panel defined in the sidebar_action manifest key.

If you set a new panel using setPanel(), and include the tabId option, then the panel is set only for the given tab. This panel is is referred to as the "tab-specific panel".

If you set a new panel using setPanel(), and omit the tabId option to setPanel(), then this sets the "global panel". The global panel will then appear in all tabs that do not have a tab-specific panel set.


  details // object


integer. Sets the panel only for a specific tab. If omitted, the global panel is set instead.
string or null. The panel to load into the sidebar, specified as a URL pointing to an HTML document, or null, or an empty string.
This can point to a file packaged within the extension (for example, created using extension.getURL), or a remote document (e.g. It must be a valid URL.
If panel is null or "", and tabId was specified, and the specified tab had a tab-specific panel set: then the tab-specific panel is reset to the global panel (if a global panel is set) or the manifest panel.
If panel is null or "", and tabId was omitted, then if there was a global panel set, it will be reset to the manifest panel.

Browser compatibility

ChromeEdgeFirefoxFirefox for AndroidOpera
Basic support No No54 No Yes
The panel property of the details parameter can be set to null. No No59 No No


This code toggles the sidebar document when the user clicks a browser action:

var thisPanel = browser.extension.getURL("/this.html");
var thatPanel = browser.extension.getURL("/that.html");

function toggle(panel) {
  if (panel === thisPanel) {
    browser.sidebarAction.setPanel({panel: thatPanel});
  } else {
    browser.sidebarAction.setPanel({panel: thisPanel});

browser.browserAction.onClicked.addListener(() => {


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.

Метки документа и участники

 Внесли вклад в эту страницу: dlwe, wbamberg, Loirooriol
 Обновлялась последний раз: dlwe,