docs.rodeo

MDN Web Docs mirror

devtools.panels.ExtensionSidebarPane.setPage()

{{AddonSidebar}} 

Sets an HTML page to be displayed in the sidebar pane.

This is an asynchronous function that returns a Promise.

Syntax

browser.devtools.panels.setPage(
  path // string containing relative path to page
)

Parameters

Return value

A Promise that will be fulfilled with no arguments, once the URL has been set.

The selected page will not be loaded until the user selects the devtools sidebar.

Examples

Create a new pane, and populate it with an HTML page. You could run this code in a script loaded by your extension’s devtools page.

function onCreated(sidebarPane) {
  sidebarPane.setPage("sidebar/sidebar.html");
}

{{WebExtExamples}} 

Browser compatibility

{{Compat}} 

[!NOTE] This API is based on Chromium’s chrome.devtools.panels API.

In this article

View on MDN