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 for setting sidebar title and icon #550

Open
twschiller opened this issue Feb 16, 2024 · 0 comments
Open

Proposal: API for setting sidebar title and icon #550

twschiller opened this issue Feb 16, 2024 · 0 comments
Labels
proposal Proposal for a change or new feature

Comments

@twschiller
Copy link

twschiller commented Feb 16, 2024

Context

  • The browser.action API has methods setTitle, setIcon, setBadgeText, and others for configuring the UI of the browser action
  • The panel dropdown in the sidebar appears to use the icon and short_text from the manifest

Motivation

  • The icon and title can provide information about the state/applicability of side panel. For example, in a page annotation/commenting extension, the number of results for the current page
  • Provide affordance for custom branding

Proposed API

  • Both browser.action and browser.sidePanel have affordances for setting different options per tab. The API for configuring the side panel entry should also support varying options by tab
  • I see two potential approaches:
    • Expose a setTitle/setIcon/setBadgeText/setBadgetTextColor/setBadgeBackgroundColor method on browser.sidePanel
    • Add an optional properties on PanelOptions title?: string, icon?: imageData | object, badgeText?: string, etc.
  • Depending on which approach vendors prefer, I can help clarify the detailed API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposal for a change or new feature
Projects
None yet
Development

No branches or pull requests

2 participants