Our FF extension can’t import scripts dynamically in local page only in FF 44.
I just follow the guide from here ( https://developer.mozilla.org/en/docs/Web/API/HTMLScriptElement ) and write the below code.
It does work below FF 44 but always fail to execute in 44 with the error message “URIError: The script toolbarpx://nsc/locale/url_check.js is not accessible.”
// This initial code need to perform before other script.
(function(w,d,n) {
// Only firefox need to load this javascript to replace the token
if (n.indexOf("firefox") > -1 && /^tmpx:\/\//.test(window.location.href)) {
w.addEventListener("load", function() {
function loadError (oError) {
throw new URIError("The script " + oError.target.src + " is not accessible.");
}
var script = d.createElement("script");
script.type = "text\/javascript";
script.onerror = loadError;
script.onload = function() {
init();
post_init();
};
d.body.onload = null;
d.body.parentNode.insertBefore(script, d.body);
script.src = "url_block.js";
script.crossorigin = "anonymous";
}, false);
}
}(window, document, navigator.userAgent.toLowerCase()));
I wonder if any big change has made in 44, but found nothing in release note.
I guess maybe FF 44 doesn’t allow to use script label with non http(s) source.
Could you guys please help on this issue?
Many many thanks in advance.