Reputation: 20925
I am trying to add an icon that displays next to the name of my Chrome extension in the extensions panel. I have tried using the following manifest.json file.
{
"name": "My Extension",
"version": "1.0",
"manifest_version": 2,
"icons": { "16": "mediumIcon.png", "48": "mediumIcon.png", "128": "mediumIcon.png" },
"description": "A practice extension.",
"browser_action": {
"default_icon": "smallIcon.png",
"default_popup": "load.html"
}
}
mediumIcon.png is 128x128. When I enter developer mode in the Extensions tab in Chrome and load my unpacked extension, the icon is not next to the name of my extension. Actually, a black-and-white version of the icon flashes for a split second, after which the default Chrome extension icon (that looks like a puzzle piece) appears.
Why not? I thought that the documentation noted that the icons can scale down if necessary.
Upvotes: 6
Views: 5877
Reputation: 66
{
"name": "Chrome Extention",
"page_action": {
},
"icons": {
"16": "images/get_started16.png",
"32": "images/get_started32.png",
"48": "images/get_started48.png",
"128": "images/get_started128.png"
}
}
Remove icons
attribute from page_action
and put it at the root level.
Upvotes: 5
Reputation: 1467
The documentation for icons in chrome extension states two things that relate to your problem:
Important: Use only the documented icon sizes.
and
provide a 48x48 icon, which is used in the extensions management page
If you provide icon of different size where 48x48 should have been used, it will be ignored. Since the icon on the management page is generated from the 48x48 version, it will not be displayed.
The solution for your problem is to provide image with correct dimensions for each icon definition.
Upvotes: 9