1

I'm trying to get the badgeText of the current Tab to display that in the popup.html. But when I use chrome.browserAction.getBadgeText, i'm getting a blank value as the result even when I can see the badge text on the icon.

I'm using Manifest version 2. And added below code in popup.js file.

Below is the code i'm using:

chrome.browserAction.getBadgeText({}, function(result) {
    console.log(result);
});
Gangula
  • 5,193
  • 4
  • 30
  • 59
  • 1
    Try passing the tabId in the first argument, like `chrome.browserAction.getBadgeText({tabId:thetabId}, function(result){console.log(result);});`. Also make sure you are checking the correct console. – Iván Nokonoko Jul 30 '22 at 17:32
  • Are you able to see other messages in the console? If not, you've probably hidden all the console messages. – Yu Zhou Aug 01 '22 at 06:23
  • Yes Yu, I'm able to see other messages. And for this code above, I see a blank line in the console. – Gangula Aug 01 '22 at 06:25

0 Answers0