V
V
Vitaly2017-05-02 09:28:49
Google Chrome
Vitaly, 2017-05-02 09:28:49

How to change color of google chrome extension icon?

All the best!
I'm working on a small extension for myself, I ran into the problem of changing the color of the icon, in the dock everything is as simple as chrome.browserAction.setBadgeBackgroundColor(object details) where object details is an array from the color code [255, 0, 0, 255] or #FF0000 but I have it doesn't work
if so:

chrome.browserAction.setBadgeBackgroundColor(['#FF0000']);

or like this :
chrome.browserAction.setBadgeBackgroundColor([255, 0, 0, 255]);

Then chrome swears - gives an error
And like this:
chrome.browserAction.setBadgeBackgroundColor({ color: [255, 0, 0, 255]});

No errors, but the color of the icon does not change, I already removed the icon from the icon in manifest , but it doesn’t work ... :(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2017-05-02
@Scorpiored88

You do not confuse a badge with a number and an extension icon ? Because you are talking about an icon, and the method is called set Badge BackgroundColor.
An icon can only be replaced with another icon, its background does not change.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question