Security error when using getURL () in Firefox WebExtension
I try to port the extension from Chrome and get this error:
Security Error: Content at "http://example.com" may not load or link to "moz-extension://04d69802-c26f-47ae-86f2-d54650455e5a/blocks/indicators/__icon/indicators__icon-tweet.png"
(function () {
'use strict';
var PATHS = {
TWITTER: chrome.extension.getURL("blocks/indicators/__icon/indicators__icon-tweet.png")
};
})();
In the manifest.json paths are specified in web_accessible_resources.
"web_accessible_resources": [
"blocks/indicators/__icon/*",
"blocks/namespace/*",
"blocks/vk-inner/*",
"moz-extension://*"
],
2
1 answers
You need to specify the full path to the resource in web_accessible_resources.
"web_accessible_resources": [
"blocks/indicators/__icon/indicators__icon-tweet.png"
]
1
Author: stsdc, 2016-05-02 20:25:12