XMLHttpRequest fails in observer method
- by Michael
I'm developing a Firefox extension and this code belongs to javascript module.
var ajax = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance();
ajax.open('GET', "http://www.google.com", true);
ajax.onload = function ()
{
Reader.log("Got News");
};
ajax.onerror = function ()
{
Reader.log("Got Error");
};
ajax.send(null);
This small code always fails (onerror) if calling from observe method invoked by preference "@mozilla.org/preferences-service;1"
Anyone knows how to make this work in observe method?