Skip to content

Bug 2044712 methods to get contextual identities icons and colors#44372

Open
rebloor wants to merge 1 commit into
mdn:mainfrom
rebloor:Bug-2044712-container-colors-and-icons-methods
Open

Bug 2044712 methods to get contextual identities icons and colors#44372
rebloor wants to merge 1 commit into
mdn:mainfrom
rebloor:Bug-2044712-container-colors-and-icons-methods

Conversation

@rebloor

@rebloor rebloor commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Description

Addresses the dev-docs-needed requirements of Bug 2044712 "Expose colors and icons to extensions" including:

  • a release note
  • methods 'getSupportedColors()' and getSupportedIcons()

Related issues and pull requests

BCD is provided in mdn/browser-compat-data#29814.

@rebloor rebloor requested review from Rob--W and bacharakis June 7, 2026 16:56
@rebloor rebloor self-assigned this Jun 7, 2026
@rebloor rebloor requested review from a team as code owners June 7, 2026 16:56
@rebloor rebloor requested review from pepelsbey and removed request for a team June 7, 2026 16:56
@rebloor rebloor added the Content:WebExt WebExtensions docs label Jun 7, 2026
@github-actions github-actions Bot added Content:Firefox Content in the Mozilla/Firefox subtree size/m [PR only] 51-500 LoC changed labels Jun 7, 2026
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor


## Changes for add-on developers

- Adds the {{WebExtAPIRef("contextualIdentities.getSupportedColors()")}} and {{WebExtAPIRef("contextualIdentities.getSupportedIcons()")}} methods to retrieve the colors and icons available for contextual identities (containers). ([Firefox bug 2044712](https://bugzil.la/2044712))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: could you move this change after the adoptedStyleSheets change? We don't really have a convention for the order, but this change to contextualIdentities is quite niche. I also anticipate another release note for more colors, which would thematically fit with this new API as well: https://bugzilla.mozilla.org/show_bug.cgi?id=2044354#c5

- `iconUrl`
- : `string`. A `resource://` URL pointing to the icon's SVG file (for example, `"resource://usercontext-content/fingerprint.svg"`).

If the contextual identities feature is not enabled, the promise is rejected with an error message.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Side note: rejecting with anel error is not what the implementation does right now, but I'll make sure that it behaves so before 153 ships to release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:Firefox Content in the Mozilla/Firefox subtree Content:WebExt WebExtensions docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants