Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add devtools.panels.ExtensionSidebarPane.setHeight #32150

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rebloor
Copy link
Contributor

@rebloor rebloor commented Feb 7, 2024

Description

I documentation for devtools.panels.ExtensionSidebarPane.setHeight

Motivation

To complement the browser compatibility data added in mdn/browser-compat-data#22182

@rebloor rebloor added the Content:WebExt WebExtensions docs label Feb 7, 2024
@rebloor rebloor requested a review from Rob--W February 7, 2024 02:05
@rebloor rebloor self-assigned this Feb 7, 2024
@rebloor rebloor requested a review from a team as a code owner February 7, 2024 02:05
@github-actions github-actions bot added the size/m [PR only] 51-500 LoC changed label Feb 7, 2024
Copy link
Contributor

github-actions bot commented Feb 7, 2024

Preview URLs

Flaws (1)

Note! 1 document with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools/panels/ExtensionSidebarPane/setHeight
Title: devtools.panels.ExtensionSidebarPane.setHeight()
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: webextensions.api.devtools.panels.ExtensionSidebarPane.setHeight
External URLs (1)

URL: /en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools/panels/ExtensionSidebarPane/setHeight
Title: devtools.panels.ExtensionSidebarPane.setHeight()

Comment on lines +17 to +19
let setting = browser.devtools.panels.setHeight(
height, // string
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setHeight() method is exposed on the ExtensionSidebarPane interface, not on the panels namespace in devtools. To my knowledge the only way to get a reference to an instance of this this interface is to create a pane using the createSidebarPane() method on certain ExtensionPanel instances: elements, network, and sources. Chrome supports all 3 of these, but Firefox only supports elements.

Please adapt this code to the appropriate conventions.

Suggested change
let setting = browser.devtools.panels.setHeight(
height, // string
)
browser.devtools.panels.elements.createSidebarPane("My Pane", (pane) => {
pane.setPage("elements-pane.html");
pane.setHeight("200px");
});

Sets the height of the sidebar.

This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to mdn/browser-compat-data#22182 this method is only supported in Chrome. Chrome's implementation does return a promise or accept a callback. When called, it immediately returns undefined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebExt WebExtensions docs size/m [PR only] 51-500 LoC changed
2 participants