0

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?

abraham
  • 44,161
  • 9
  • 92
  • 140

2 Answers2

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