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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user