That must be declared in harness-options.json
why my firefox add-on cannot do Request
-
14-07-2023 - |
Question
My addon is working fine without bugs, But If add the bellow code in my addon script Main.js then my extension will not work at all.
Why?
What I should do ?
var Request = require("sdk/request").Request;
var quijote = Request({
url: "http://www.latin1files.org/",
onComplete: function (response) {
console.log(response.text);
}
});
quijote.get();
Addon:
https://addons.cdn.mozilla.net/_files/478037/proxylist-initial.rev19-fx.xpi
So the addon is not working if I want to use Request or Timer. How to resolve this ?
I think the problem is in settings files, maybe in bootstrap.js or harness-options.json, or somewhere where it must be initialized, but i don't know much about firefox addon sdk. I know that above code must work, but i need to include or to declare something that will allow me to use Request.
Solution
OTHER TIPS
There is no request.js file in your /resources/addon-sdk/lib/sdk/ folder. As you can see in the comments to the announcement of SDK 1.15, bundling the SDK modules with the extension is no longer necessary (since FF21).