w3c / webextensions

Charter and administrivia for the WebExtensions Community Group (WECG)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proposal: API for setting sidebar title and icon

twschiller opened this issue · comments

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