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
  • 46,583
  • 10
  • 100
  • 152

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
  • 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