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

Proposal: API to programmatically open the developer tools to a particular panel #476

Closed
twschiller opened this issue Oct 24, 2023 · 1 comment
Labels
opposed: chrome Opposed by Chrome opposed: firefox Opposed by Firefox opposed: safari Opposed by Safari proposal Proposal for a change or new feature

Comments

@twschiller
Copy link

twschiller commented Oct 24, 2023

Context

  • The developer tools can currently only be triggered via keyboard shortcut or the native browser context menu
  • That's an onboarding barrier to end-user programming tools that benefit from living in the developer tools (e.g., the application persists across frame navigation)
  • Today, low-code/end-user programming tools often choose to instead use floating elements that need to constantly be repositioned/dragged, or use the new sidebar panel API, which is a restrictive form factor
  • It also hurts navigational efficiency for developer extensions. There are empty keyboard shortcuts/clicks to open the developer tools and navigate to the particular panel state of interest

Use Cases

  • Deep linking to a screen in the developer tools panel when the developer tools are not already open. For example:
    • To provide framework-specific "inspect" functionality (e.g., for React Dev Tools)
    • To open an editor for low-code capabilities provided by the extension (e.g., crawler definitions, automation definitions, theme definitions, user scripts, etc.)
  • Opening the developer tools as part of an onboarding flow to demonstrate extension usage

Potential API:

From the content script:

browser.devtools.panels.openPanel({
  // Optional title to match against panels added by `devtools_page`
  title?: string,
  // Optional docking hint, if the user has not previously docked the dev tools
  dockSide?: "left" | "right" | "bottom" | "window"
  // Optional page path to update path for deep linking
  pagePath?: string
})

Permissions Considerations

  • Could require the interaction to come from a user gesture
  • Could restrict opening panel to a panel added by the extension
  • Currently, enterprise organizations can set a browser policy to restrict access to the developer tools. (Organizations already have control over potential abuse of opening the developer tools.)

Resources/Reference

@twschiller twschiller changed the title Proposal: API to programmatically open a panel in the developer tools Proposal: API to programmatically open the developer tools to a particular panel Oct 24, 2023
@xeenon xeenon added proposal Proposal for a change or new feature opposed: safari Opposed by Safari and removed needs-triage labels Nov 9, 2023
@oliverdunk oliverdunk added the opposed: chrome Opposed by Chrome label Nov 9, 2023
@Rob--W Rob--W added the opposed: firefox Opposed by Firefox label Nov 9, 2023
@Rob--W
Copy link
Member

Rob--W commented Nov 9, 2023

Every vendor is opposed to an API to open the devtools when it's not already open.

There is more appetite for switching panels when the devtools is already open, but we also need to think of the implications of that.

@Rob--W Rob--W closed this as completed Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
opposed: chrome Opposed by Chrome opposed: firefox Opposed by Firefox opposed: safari Opposed by Safari proposal Proposal for a change or new feature
Projects
None yet
Development

No branches or pull requests

4 participants