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

Support browserAction.setBadgeTextColor() #216

Closed
AidanWelch opened this issue May 27, 2022 · 7 comments
Closed

Support browserAction.setBadgeTextColor() #216

AidanWelch opened this issue May 27, 2022 · 7 comments
Labels
implemented: chrome Implemented in Chrome implemented: firefox Implemented in Firefox inconsistency Inconsistent behavior across browsers neutral: safari Not opposed or supportive from Safari

Comments

@AidanWelch
Copy link

Firefox has supported setBadgeTextColor() since 2018, but no other browsers currently support it. Standardizing a relatively minor function that would improve the customization of extension badges seems beneficial.

@carlosjeurissen
Copy link
Contributor

In addition to browserAction.setBadgeTextColor, Firefox also implemented browserAction.getBadgeTextColor. And for compatibility with manifest v3, action.setBadgeTextColor and action.getBadgeTextColor should be considered.

Some additional background can be found in the bugzilla issue report:
https://bugzilla.mozilla.org/show_bug.cgi?id=1424620

I suggest to first discuss how the foreground color is determined by browsers, see if we can find alignment on this field as well.

@carlosjeurissen carlosjeurissen added the inconsistency Inconsistent behavior across browsers label May 31, 2022
@dotproto dotproto added the follow-up: chrome Needs a response from a Chrome representative label Jun 9, 2022
@xeenon
Copy link
Collaborator

xeenon commented Jun 9, 2022

We should keep dark mode in mind here. We likely would need to let the caller set a color for each mode so it can look right if/when the user switches their UI between light and dark modes.

@hanguokai
Copy link
Member

hanguokai commented Jun 13, 2022

I would like to know what is the default BadgeTextColor and BadgeBackgroundColor in different browsers (if developers don't set them).

On Chrome, the default is White/Blue. And Edge's was the same as Chrome in the past. But recently Edge changed to White/Red.

@hanguokai
Copy link
Member

Here is a related chromium bug about badge's color contrast. The problem is that, in some cases, the badge text color chosen by the browser is unreadable, especially the badge is very small. Maybe some color experts can help solve it.

@dotproto dotproto removed the follow-up: chrome Needs a response from a Chrome representative label Jul 20, 2022
@dotproto
Copy link
Member

Chrome is open to exposing action.setBadgeTextColor() but don't have immediate plans to do so. We will be using crbug.com/1337783 to track this feature request.

@carlosjeurissen
Copy link
Contributor

There is further progress on this on https://crbug.com/1363445

@hanguokai
Copy link
Member

Close this issue. Because Chrome has implemented action.setBadgeTextColor() and action.getBadgeTextColor(). They are available since Chrome 110.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implemented: chrome Implemented in Chrome implemented: firefox Implemented in Firefox inconsistency Inconsistent behavior across browsers neutral: safari Not opposed or supportive from Safari
Projects
None yet
Development

No branches or pull requests

5 participants