Gets a URL to the HTML document that defines the sidebar's contents.
This is an asynchronous function that returns a Promise
.
Gets a URL to the HTML document that defines the sidebar's contents.
This is an asynchronous function that returns a Promise
.
let gettingPanel = browser.sidebarAction.getPanel(
details // object
)
details
object
. An object with the following properties:
tabId
Optional
integer
. Get the panel for the sidebar specific to the given tab.
windowId
Optional
integer
. Get the panel for the sidebar specific to the given window.
windowId
and tabId
are both supplied, the function fails and the promise it returns is rejected.windowId
and tabId
are both omitted, the global panel is returned.A Promise
that will be fulfilled with a string containing the URL for the panel's document. This will be a fully qualified URL, such as:
moz-extension://d1d8a2eb-fe60-f646-af30-a866c5b39942/sidebar.html
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
getPanel |
No | No | 54 | ? | 30 | No | ? | ? | No | ? | No | ? |
Get the panel's URL:
function onGot(sidebarUrl) {
console.log(sidebarUrl);
}
let gettingPanel = browser.sidebarAction.getPanel({});
gettingPanel.then(onGot);
Note: This API is based on Opera's chrome.sidebarAction
API.
© 2005–2023 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/getPanel