Search code examples
jsongoogle-chrome-extension

Chrome extension icon not appearing


    [!["manifest_version": 2,
    "icons": {
        "16": "/images/icon16.png",
        "48": "/images/icon48.png",
        "128": "/images/icon128.png"
    },
    "browser_action": {
        "default_icon": {                    
            "16": "images/icon16.png",          
            "48": "images/icon48.png",
            "128": "images/icon128.png"       
          },
        "default_popup": "/screens/popup.html"
    },
    "permissions": \["tabs", "storage", "webNavigation"\],
    "content_scripts": \[
        {
            "js": \["popup.js", "websites.js"\],
            "matches": \[
                "<all_urls>"
            \]
        }
    \],
    "background": {
        "scripts": \["background.js"\],
        "persistent": false
    },
    "content_security_policy": "script-src 'self' https://ajax.googleapis.com https://stackpath.bootstrapcdn.com; object-src 'self';"
}

it is giving me the blue puzzle piece in the middle

I don't know why my chrome extension icon isn't showing. I saved all the icons into the images folder hence the /images. it is giving me the blue puzzle piece in the middle Is there something wrong with my code?


Solution

  • This example is working on my browser. I don't know why your manifest json starts with [![. Maybe this is the problem. I'm not sure. Can you edit this example according to your json file?

    {
      "manifest_version": 2,
      "name": "Test",
      "description": "Test",
      "version": "1.0",
      "browser_action": {
        "default_icon": {
          "16": "images/icon16.png",
          "48": "images/icon48.png",
          "128": "images/icon128.png"
        },
        "default_popup": "popup.html"
      },
      "permissions": [
        "activeTab"
      ]
    }