4

I am trying to add a heavy check mark () to my Chrome extension’s badge text. When I update the badge from a background script, it works fine. When I update it from a script within the popup window, it renders as ✔.

chrome.browserAction.setBadgeText({
  text: '✔',
  tabId: tabId
});
Alexander
  • 638
  • 3
  • 11
  • have you tried it with the html code `✔` rather than the character itself? – Alessi 42 May 20 '17 at 20:43
  • Yes. Then I literally get `✔`. – Alexander May 20 '17 at 20:45
  • It seems someone else had a similar issue http://stackoverflow.com/questions/31498506/how-to-set-unicode-character-as-badge-text-on-browser-action-in-chrome-extension – Alessi 42 May 20 '17 at 20:49
  • That’s a different problem. I know the check mark character can render properly because it works when I call it from the background script. – Alexander May 20 '17 at 20:50

1 Answers1

5

The popup window is probably not defaulting to the correct character encoding.

You need to put <meta charset="utf-8"> in the head of your popup window.

Whitecat
  • 3,882
  • 7
  • 48
  • 78