【问题标题】:Chrome Extension Icon ManifestChrome 扩展程序图标清单
【发布时间】:2018-03-09 15:41:37
【问题描述】:

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

这是我的清单代码:

{
  "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 页面上的图标未更改。

【问题讨论】:

    标签: json google-chrome google-chrome-extension browser-extension


    【解决方案1】:

    设置"icons" 键入manifest.json

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

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

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

    【讨论】:

      【解决方案2】:

      应该是:

      {
        "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 Extension Manifest Docs

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-07-09
        • 2013-05-31
        • 1970-01-01
        • 2018-01-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多