简体   繁体   English

chrome扩展程序中未显示浏览器操作图标

[英]browser action icon is not shown in chrome extension

This my manifest: 这是我的清单:

{
  "name": "Test",
  "description": "Appliation",
  "manifest_version": 2,
  "version": "0.1",
  "app": {
    "background": {
      "scripts": ["background.js"]
    }
  },
  "icons": { "16": "phone16.png", "256": "phone256.png" },
    "browser_action": {
   "default_title": "action description",
   "default_icon": "phone20.png"
}
}

But when install this extension browser action icon is not shown. 但是,安装此扩展程序时,浏览器操作图标不会显示。 Is there any problem? 有什么问题吗? Hoe can I show? 我可以展示show头吗?

You are declairing a Chrome App, not an extension: 您声明的是Chrome应用,而不是扩展程序:

"app": {
    ...
}

Change the above block to: 将上面的块更改为:

"background": {
    "scripts": ["background.js"]
}

(Ie remove the wrapping app property, just leave background .) (即,删除包装app属性,只需保留background 。)

Try this Manifest: 试试这个清单:

{
    "name": "Test",
    "version": "0.1",
    "manifest_version": 2,
    "description": "Appliation",
    "browser_action": {
        "default_title": "Test",
        "default_icon": "images/phone19.png",
    },
    "icons": { 
        "19": "images/phone19.png", 
    },
    "background": {
        "scripts": ["background.js"]
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM