Chrome扩展程序图标没有颜色

Tha*_*der 7 google-chrome-extension

我刚创建了第一个Chrome扩展程序.我的扩展程序图标在扩展管理器页面中正确显示(带颜色): 带有颜色的图标

但Chrome在扩展栏中显示了我的图标的灰度版本: 没有颜色的图标

这是我的扩展的清单:

{
  "name": "__MSG_appName__",
  "version": "0.0.1",
  "manifest_version": 2,
  "description": "__MSG_appDescription__",
  "icons": {
    "16": "images/icon-16.png",
    "128": "images/icon-128.png"
  },
  "default_locale": "en",
  "background": {
    "scripts": [
      "scripts/chromereload.js",
      "scripts/background.js"
    ]
  },
  "permissions": [
    "tabs",
    "http://*/*",
    "https://*/*",
    "contentSettings"
  ],
  "content_scripts": [
    {
      "matches": [
        "http://*/*",
        "https://*/*"
      ],
      "js": [
        "scripts/contentscript.js"
      ],
      "run_at": "document_end",
      "all_frames": false
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能让Chrome在地址栏旁边显示带有颜色的图标?

谢谢

Noa*_*ker 13

这是奇怪的行为,我不知道它为什么会发生,但我知道解决方案:你应该使用default_icon而不是icon:

"browser_action": {
    "default_icon": "icon.png"
}
Run Code Online (Sandbox Code Playgroud)

请注意,图标需要为19x19或38x38像素.

您已正确定义了较大的图标,因此可以保留原样.

有关详细信息,请参见此处