Chrome扩展程序在Chrome启动时加载了错误的图标

时间:2018-04-08 23:31:38

标签: google-chrome-extension

以下清单应该加载off.png浏览器操作图标,但是当我在on.png图标处于活动状态时关闭Chrome时,当我启动Chrome时,由于某种原因,它会自动加载图标。< / p>

这是某种错误吗?

清单:

{
"background": {
   "scripts": ["js/bg/bg.js" ],
   "persistent": false
},
"browser_action": {
  "default_icon": "style/off.png",
  "default_title": "__MSG_mainTitle__"
},
"default_locale": "en",
"description": "__MSG_description__",
"icons": {
  "128": "style/on.png"
},
"manifest_version": 2,
"name": "__MSG_name__",
"offline_enabled": true,
"version": "2.5.5"
}

bg.js:

chrome.browserAction.onClicked.addListener(function(){
    chrome.browserAction.setIcon({path: "/style/" + 'on' + ".png"})
});

0 个答案:

没有答案