Yeah the general un-sandboxed xmlhttprequest might be an issue. I do it like so:
xhr: function(method, uri, progress) {
try {
var xml = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Components.interfaces.nsIXMLHttpRequest);
if (progress) {
xml.onprogress = gui.onprog(progress);
}
xml.open(method, uri, false);
xml.overrideMimeType("text/plain");
xml.channel.loadFlags |= Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE;
xml.send(null);
return xml;
} catch(e) {
return false;
}
}
It's a bit different. Then you have to build new functions for it to work. Or we simply could bind our own xml object to:
var req = window.Hackvertor.createXHR();
And leave the original object out?
But we also have eval instances which are quite security prone in extensions, not sure how to tackle those then.
We could do this:
Components.utils.evalInSandbox
Or simply:
eval("(function() { return " + js + " })");
Any suggestions?