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 53 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
- 71,217
- 14
- 165
- 189
0
Badge is plain text only as can be seen in source code. There's no way around.
wOxxOm
- 53,493
- 8
- 111
- 119