Recommended size of icon for Google Chrome Extension
Both are correct ! They are for different sections/features:
The former refers to the browser-action icon (displayed on the top-right corner of your browser-window, next to the address bar). It is only displayed if your extension registers a browser-action.
The latter refers to icons used throughout the extension and browser, as is explained quite clearly in the link you provide:
(emphasis mine)
One or more icons that represent the extension, app, or theme. You should always provide a 128x128 icon; it's used during installation and by the Chrome Web Store. Extensions should also provide a 48x48 icon, which is used in the extensions management page (chrome://extensions). You can also specify a 16x16 icon to be used as the favicon for an extension's pages. The 16x16 icon is also displayed in the experimental extension infobar feature.
BTW, that second link mentions icon
as the property name, which was replaced in Manifest v2 by default_icon
.
("Migration to Manifest v2" guide)
To elaborate on ExpertSystem's answer, here is an example manifest excerpt with all of the image sizes:
"browser_action": {
"default_icon": {
"19": "images/icon19.png",
"38": "images/icon38.png"
},
"default_popup": "popup.html"
},
"icons": { "16": "images/icon16.png",
"48": "images/icon48.png",
"128": "images/icon128.png" }, ...
Notice how the 19/38 icons are for the browser action, and the 16/48/128 are at the icons level.
I think it is best therefore to create the image as a vector graphic (e.g. svg file) and then save to a bitmap (e.g. png file) for each of the sizes.
2020 Update:
I was researching this recently. Here is what I found:
These sizes seem to cover most scenarios: 16, 24, 32, 48, 128
These sizes seem to be outdated: 19, 38
Icons - Recommended Sizes:
16, 24, 32, 48, 128.
Size: Manifest - Icons: chrome.browserAction:
16 Yes Yes
24 No Yes
32 Yes Yes
48 Yes No
128 Yes No
- Manifest - Icons: https://developer.chrome.com/extensions/manifest/icons
- chrome.browserAction: https://developer.chrome.com/extensions/browserAction
Icons - Outdated Sizes:
19, 38.
Size: Manifest - Icons: chrome.browserAction:
19 No Outdated
38 No Outdated
- chrome.browserAction: https://chrome-apps-doc2.appspot.com/extensions/browserAction.html
For browser action, we just need a 16x16 icon now, as
The browser action icons in Chrome are 16 dips (
device-independent pixels
) wide and high.