Can I put a HTML code in my chrome extension's icon? According to the Google API (setBadgeText) this isn't possible. Is there any way to put it there?
Asked
Active
Viewed 67 times
0
-
1Can you give an example of what you're trying to achieve? – Xan Jul 18 '16 at 09:18
2 Answers
2
While .setBadgeText
is, as implied by name, text-only, you can draw anything and set that as your icon.
You'll need to draw on a <canvas>
, extract image data and use .setIcon({imageData: /*...*/})
to update the icon.
See this question for a brief example, and maybe this article.
It's not quite "using HTML", but with some work you can output anything to your icon.

Xan
- 74,770
- 16
- 179
- 206
0
Badge is plain text only as can be seen in source code. There's no way around.

wOxxOm
- 65,848
- 11
- 132
- 136