1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 03:14:12 +01:00

Fix some minor bugs.

--HG--
branch : groups
This commit is contained in:
Kris Maglione
2011-02-09 14:58:35 -05:00
parent 36c382cdf4
commit 1299fddfd3
2 changed files with 23 additions and 12 deletions

View File

@@ -770,14 +770,18 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
try {
let xmlhttp = services.Xmlhttp();
xmlhttp.mozBackgroundRequest = true;
if (params.callback) {
xmlhttp.onload = function handler(event) { util.trapErrors(params.callback, params, xmlhttp, event) };
xmlhttp.onerror = xmlhttp.onload;
let async = params.callback || params.onload || params.onerror;
if (async) {
xmlhttp.onload = function handler(event) { util.trapErrors(params.onload || params.callback, params, xmlhttp, event) };
xmlhttp.onerror = function handler(event) { util.trapErrors(params.onerror || params.callback, params, xmlhttp, event) };
}
if (params.mimeType)
xmlhttp.overrideMimeType(params.mimeType);
xmlhttp.open(params.method || "GET", url, !!params.callback, params.user, params.pass);
xmlhttp.open(params.method || "GET", url, async,
params.user, params.pass);
xmlhttp.send(null);
return xmlhttp;
}