I want to download some data in my XPCOM component. I made this code:
Code: Select all
for (var el in this.ObservedSites)
{
var Request =
Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
.createInstance(Components.interfaces.nsIXMLHttpRequest);
Request.open("GET", this.ObservedSites[el].URL, true);
Request.el = el;
Request.onload = this.siteChecked;
Request.send(null);
}
I set Request.el to identify responses (as in http://kb.mozillazine.org/XMLHttpReques ... nous_calls - adding custom data to XMLHttpRequest object).
But I've got this error:
Cannot modify properties of a WrappedNative = NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN
on the line:
Code: Select all
Request.el = el;
Is there any way to make this asynchronous and to identify (in the onload event) requests?