1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-26 22:45:46 +01:00

Add :sidebar!. Closes issue #269.

This commit is contained in:
Kris Maglione
2011-01-22 07:14:55 -05:00
parent e8603ed458
commit f33ae2b044
4 changed files with 41 additions and 9 deletions

View File

@@ -743,15 +743,14 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
* @param {function(XMLHttpRequest)} callback
* @returns {XMLHttpRequest}
*/
httpGet: function httpGet(url, callback) {
httpGet: function httpGet(url, callback, self) {
try {
let xmlhttp = services.Xmlhttp();
xmlhttp.mozBackgroundRequest = true;
if (callback)
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4)
callback(xmlhttp);
};
if (callback) {
xmlhttp.onload = function handler(event) { util.trapErrors(callback, self, xmlhttp, event) };
xmlhttp.onerror = xmlhttp.onload;
}
xmlhttp.open("GET", url, !!callback);
xmlhttp.send(null);
return xmlhttp;