Chrome扩展程序图标清单

时间:2017-09-28 02:18:44

标签: google-chrome google-chrome-extension

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

enter image description here

这是我的清单代码:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<img class="image" src="http://placehold.it/100" />

工具栏上的图标已更改,但未在{ "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" ] } 页面上更改。谢谢。

2 个答案:

答案 0 :(得分:2)

browser_action.icons键显示在工具栏中(并且可能只使用16,24和32大小的图像,请参阅browserAction)。 chrome://extensions中显示的密钥是顶级icons密钥。在manifest documentation中,查找第6个条目,以便您的清单最终为:

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

或对此进行一些重新排序。

答案 1 :(得分:0)

应该是:

{
    "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"]
  }

请参阅:https://developer.chrome.com/extensions/manifest