0
votes

So I made a chrome extension but the "default_icon" under "browser_action" is not working for me. I can't see the icon when I reload the chrome extension. Is there something I might have been missed?

manifest.json

 {
"name": "New Extension",
"description" : "Base Level Extension",
"version": "1.0",
"manifest_version": 2,
"content_scripts" : [
    {
        "matches" : [
            "<all_urls>"
        ],
        "js" : ["content.js"]
    }
],
"background":
{
    "scripts" : [
        "background.js"
    ],

    "browser_action": {
        "default_icon": "icon.png" 
    }
}

}

I have the "icon.png" in the same folder and both "content.js" and "background.js" have 2 console.log statements which are working fine and showing up!

1
Move "browser_action" block outside of "background" block.wOxxOm

1 Answers

0
votes

Try moving the "browser_action" block outside so it is not nested in the "background" block.

 {
   "name": "New Extension",
   "description" : "Base Level Extension",
   "version": "1.0",
   "manifest_version": 2,
   "content_scripts" : [{
        "matches" : [
            "<all_urls>"
        ],
        "js" : ["content.js"]
      }
   ],
   "background": {
        "scripts" : [
          "background.js"
        ]
   },
   "browser_action": {
        "default_icon": "icon.png" 
   }
}

https://developer.chrome.com/extensions/manifest