chrome 应用小试- 更改背景颜色无效

问题代码

#manifest.json的内容

{
	"name": "Login",
	"version": "2.0",
	"manifest_version": 2,
	"description": "The first extension that I made.",
	 "background": {
       "scripts": ["background.js"],
	   "persistent": false
	  },
	"browser_action": {
		"default_icon": "icon.png",
		"default_title": "Make this page red"
	},
	"permissions": ["activeTab"]
	
}

  可能是由于 "permissions": ["activeTab" ]位置没写对

将 其写在 

"browser_action"前试试
{
	"name": "Login",
	"version": "2.0",
	"manifest_version": 2,
	"description": "The first extension that I made.",
	"permissions": ["activeTab"],
	 "background": {
       "scripts": ["background.js"],
	   "persistent": false
	  },
	"browser_action": {
		"default_icon": "icon.png",
		"default_title": "Make this page red"
	}	
}

官方文件示例地址:

 https://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/browserAction/make_page_red/manifest.json?sortdir=down&pathrev=193858

posted @ 2018-01-21 15:18  BigOrang  阅读(475)  评论(0编辑  收藏  举报