Nadeem Ahmad
Nadeem Ahmad

Reputation: 35

There was an error during installation: Extension is invalid - Unknown error

can someone find out what is the error in my extension, I do not know why it is saying invalid extension when i try to upload it temporarily. I have developed the same extension for chrome, it works there fine, also operates on opera but not going to install on fireFox. Can anyone specify the problem. Below is my manifest :

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

}

I did not use any chrome APIs in the content scripts yet, i just used one which is chrome.extension.getURL() which i have changed to browser.extension.getURL() but still getting that error.

Upvotes: 2

Views: 1494

Answers (1)

Paul Heil
Paul Heil

Reputation: 293

It looks like your background entry is invalid. Background scripts run in the background globally so I don't think defining matching URLs is doing anything for you. BTW Firefox will accept either chrome or browser commands.

Try

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

Upvotes: 2

Related Questions