Chrome Extension Icon Manifest

可紊 提交于 2020-06-25 09:54:14

问题


How to change Chrome Extension icon in this page?

Here's my manifest code :

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

The icon on toolbar is changed, but not on the chrome://extension page. thank you.


回答1:


Set "icons" key in manifest.json.

The browser_action.icons key is what gets displayed in the toolbar (and will probably only use 16, 24, and 32 sized images, see browserAction).

The one displayed in chrome://extensions is a top level icons key. In the manifest documentation, look for the 6th entry, so that your manifest has an top-level entry, like:

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



回答2:


It should be:

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

See: https://developer.chrome.com/extensions/manifest



来源:https://stackoverflow.com/questions/46459939/chrome-extension-icon-manifest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!