user3666035
user3666035

Reputation: 121

Chrome extension icon not appearing?

I'm trying to get an icon to appear for an extension at chrome://extensions/ page. My manifest is as follows:

{
  "name":"Hello World",
  "version" : "1.0",
  "description":"Hello World",
  "icons": {                   
    "19": "icon19.png",
    "38": "icon38.png",
    "48": "icon48.png",
    "128": "icon128.png"  
  },    
  "browser_action": {
    "default_icon": {                   
      "19": "icon19.png",
      "38": "icon38.png",
      "48": "icon48.png",
      "128": "icon128.png"        
    }
  },
  "manifest_version": 2
}

As you can tell, I've tried putting icons all over. They are all the corresponding size, but I simply cannot get an icon to appear in the extensions menu. Thanks in advance.

Upvotes: 12

Views: 20587

Answers (4)

rtnF14
rtnF14

Reputation: 11

Here is the code sample for manifest.json

{
"name" : "App Name",
"description" : "App Description",
"version": "1.0",
"manifest_version": 2,
"browser_action": {
    "default_popup": "hello.html",
    "default_icon": "h.png"
}
}

Make sure "h.png" is on the same directory as manifest.json, and also make sure it is a PNG file with 16x16 pixel resolution. Works for me

Upvotes: 0

Rishabh Agrahari
Rishabh Agrahari

Reputation: 3717

The issue in my case was the format of icons, I was using jpeg format (and doc says: Icons should generally be in PNG format, because PNG has the best support for transparency. They can, however, be in any format supported by WebKit, including BMP, GIF, ICO, and JPEG.) but still it wasn't working. I converted the icons to png format and it worked.

Upvotes: 4

Xan
Xan

Reputation: 77523

  • The manifest key that controls the icon in chrome://extensions/ is icons.48.

    So, make sure your file "icon48.png" exists and is in the right place.

  • Also, documentation mentions:

    You may provide icons of any other size you wish, and Chrome will attempt to use the best size where appropriate.

    You can also provide icons that are not of the "announced" size, e.g. a 128x128 icon for a 48x48. It will be scaled as necessary; but it's best to create a scaled version yourself.

  • It should be of an appropriate format.

    Static images can be in any format WebKit can display, including BMP, GIF, ICO, JPEG, or PNG. For unpacked extensions, images must be in the PNG format.

  • Finally, make sure you reloaded your extension after making those changes.

Upvotes: 15

RichLitt
RichLitt

Reputation: 482

I had an issue with the image file, which seemed fine on my machine. Using a new image fixed the trick, with only the standard icons object.

Upvotes: 1

Related Questions