this.id = service + method + Math.random();
this.cancelled = false;
+ this.setSecure(false);
+ if(isXUL()) this.setSecure(true);
+
_allrequests[this.id] = this;
var i = 2;
/* determine the xmlhttp server dynamically */
var url = location.protocol + "//" + location.host + "/" + XML_HTTP_GATEWAY;
- if(isXUL() && XML_HTTP_SERVER) {
- if(this.secure || url.match(/^https:/) )
- url = "https://" + XML_HTTP_SERVER + "/" + XML_HTTP_GATEWAY;
- else
- url = "http://" + XML_HTTP_SERVER + "/" + XML_HTTP_GATEWAY;
+ if(isXUL()) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
+ if( this.secure ) url = url.replace(/http/, 'https');
+ else url = url.replace(/https/, 'http');
}
- /* this number could be a lot higher.. */
- var whole = url + this.param_string + 1;
-
var data = null;
if( this.type == 'GET' ) url += "?" + this.param_string;
+ if(isXUL() && this.secure ) dump('SECURE = true\n');
+
try {
if(blocking) this.xmlhttp.open(this.type, url, false);
else this.xmlhttp.open(this.type, url, true);
} catch(E) {
- alert("Fatal error opening XMLHTTPRequest for URL:\n" + url + '\n');
+ alert("Fatal error opening XMLHTTPRequest for URL:\n" + url + '\n' + E);
return;
}
this.request = new RemoteRequest(s[0], s[1]);
var p = [];
+ if(isXUL()) {
+ if(!location.href.match(/https:\/\//))
+ this.request.setSecure(false);
+ }
+
for( var x = 1; x!= arguments.length; x++ ) {
p.push(arguments[x]);
this.request.addParam(arguments[x]);