Chrome扩展图标清单

16

如何在此页面中更改Chrome扩展程序图标?

extension description

这是我的清单代码:
{
  "manifest_version": 2,
  "name": "Demo",
  "description": "This is demo.",
  "version": "1.0",
  "browser_action": {
    "default_icon": "icon128.png",
    "icons": {
       "16": "icon16.png",
       "48": "icon48.png",
      "128": "icon128.png"
    },
    "default_popup": "popup.html"
  },
  "permissions": [
    "activeTab",
    "storage"
  ]
}

工具栏上的图标已更改,但在chrome://extension页面上没有更改。
2个回答

27

manifest.json 中设置 "icons" 键。

browser_action.icons 键是显示在工具栏中的内容(通常只使用 16、24 和 32 大小的图像,请参见 browserAction )。

chrome:// extensions 中显示的是顶级 icons 键。在 清单文档中查找第6个条目,以使您的清单具有顶级条目,例如:

{
  "icons": {
    "16": "icon16.png",
    "48": "icon48.png",
    "128": "icon128.png"
  }
}

12

应该是:

{
  "manifest_version": 2,
  "name": "Demo",
  "description": "This is demo.",
  "version": "1.0",
  "icons": {
    "16": "icon16.png",
    "48": "icon48.png",
    "128": "icon128.png"
  },
  "browser_action": {
    "default_popup": "popup.html"
  },
  "permissions": ["activeTab", "storage"]
}  

参见:Chrome 扩展清单文档


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接