Index: lib/io.js |
=================================================================== |
--- a/lib/io.js |
+++ b/lib/io.js |
@@ -67,17 +67,17 @@ let IO = exports.IO = |
* The callback will be called when the operation is done. |
*/ |
readFromFile: function(/**nsIFile|nsIURI*/ file, /**Boolean*/ decode, /**Object*/ listener, /**Function*/ callback, /**String*/ timeLineID) |
{ |
try |
{ |
let buffer = ""; |
let uri = file instanceof Ci.nsIFile ? Services.io.newFileURI(file) : file; |
- let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest); |
+ let request = new XMLHttpRequest(); |
request.mozBackgroundRequest = true; |
request.open("GET", uri.spec); |
request.responseType = "moz-chunked-text"; |
request.overrideMimeType("text/plain" + (decode ? "? charset=utf-8" : "")); |
request.addEventListener("progress", function(event) |
{ |
if (timeLineID) |