Branden Ham Branden Ham - 1 month ago 20
Javascript Question

Content Security Policy: The page’s settings blocked the loading of a resource

I've been trying to move a simple program I made in jQuery/HTML to a Firefox WebExtension for easy deployment. The error I am getting is:

Content Security Policy: The page’s settings blocked the loading of a resource at https://code.jquery.com/jquery-1.12.4.js (“script-src moz-extension://ef8f1295-1912-4912-ab2e-121053b6781a”).


I'm sure I'm just not doing the manifest.json file right, but for the life of me I don't know where:

{
"description": "Makes tasks from different underwriters uniform",
"manifest_version": 2,
"name": "Task Creator",
"version": ".5",
"permissions": [
"http://*/*", "tabs", "https://*/*"
],

"icons": {
"48": "icons/page-48.png"
},
"web_accessible_resources": [
"style/popUpStyle.css",
"script/popUpTask.js",
"script/logicTaskFiller.js",
"js/autosize.js",
"style/https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css",
"js/https://code.jquery.com/jquery-1.12.4.js",
"js/https://code.jquery.com/ui/1.12.1/jquery-ui.js"
],

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

"browser_action": {
"default_icon": "icons/page-32.png"
}
}

Answer

Extensions cannot load scripts, or other object resources, from the Internet. All CSS and Javascript used by your extension must be part of the extension package.

(This documentation is from Chrome, but the exact same policies apply to Firefox WebExtensions.)

Comments