1

added this in my background.js

chrome.browserAction.setBadgeBackgroundColor({ color: [122, 186, 122, 255] });
chrome.browserAction.setIcon({path: 'ico.png'});
chrome.browserAction.setBadgeText({text: '1'});

and my error:

Uncaught TypeError: Cannot read property 'setBadgeBackgroundColor' of undefined
    at background.js:84

simply can't add the badge next to the icon.

UPDATE: my manifest.json

"content_scripts": [
   {
     "matches": ["<all_urls>"],
     "css": ["background.css"],
      "js": ["background.js"]
   }
 ],
 "web_accessible_resources": [
    "images/*"
  ],
"browser_action": {
   "default_title": "Does a thing when you do a thing",
   "default_popup": "popup.html",
   "default_icon": {
     "16": "icons/icon16.png",
     "32": "icons/icon32.png"
   }
 }
bboy
  • 1,357
  • 2
  • 15
  • 31

0 Answers0