安装期间出错:扩展无效 - 未知错误

时间:2017-12-31 09:51:30

标签: firefox-addon

有人可以找出我的扩展程序中的错误,我不知道为什么当我尝试暂时上传它时它会说无效扩展名。我已经为chrome开发了相同的扩展,它在那里工作得很好,也可以在opera上运行但不会在fireFox上安装。任何人都可以指定问题。以下是我的清单:

{
	"name":"My Work Book",
	"description":"Save & Manage Your Jobs with ease",
	"version":"1.0",
	"manifest_version":2,
	"icons":{
		"16":"icons/job_icon.png",
		"32":"icons/job_icon.png",
		"64":"icons/job_icon.png"
	},
	"content_scripts":[{
		"matches":[
			"<all_urls>"
		],
		"css": [
			"plugins/bootstrap.min.css",
			"plugins/fa/css/font-awesome.css",

			"style.css"
		],
		"js":[
			"plugins/jquery.js",
			"plugins/drag.js",
			"content.js",
			"general.js"
		]
	}],
	"web_accessible_resources": [
		"Icons/*.png",
		"Icons/*.svg",
	    "plugins/fa/css/*.css",
	    "plugins/fa/fonts/fontawesome-webfont.eot?v=4.7.0",
		"plugins/fa/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0",
	    "plugins/fa/fonts/fontawesome-webfont.woff2?v=4.7.0",
	    "plugins/fa/fonts/fontawesome-webfont.woff?v=4.7.0",
	    "plugins/fa/fonts/fontawesome-webfont.ttf?v=4.7.0",
	    "plugins/fa/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular"
	],
	"background":[{
		"matches":[
	        "<all_urls>"
		],
		"scripts":[
            "plugins/jquery.js",
            "background.js"
		]
	}],
	"permissions":[
        "<all_urls>"
	],
	"browser_action":{
		"default_icon":"icons/job_icon.png"
	}

}

  

我还没有在内容脚本中使用任何Chrome API,我只使用了chrome.extension.getURL(),我已将其更改为browser.extension.getURL()但仍然出现错误。

1 个答案:

答案 0 :(得分:0)

看起来你的背景条目无效。后台脚本在后台全局运行,因此我不认为定义匹配的URL正在为您做任何事情。 BTW Firefox将接受chrome或浏览器命令。

尝试

"background":{
    "scripts":["plugins/jquery.js","background.js"]
},