var ioservice = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); var handler = Components.classes["@mozilla.org/network/protocol;1?name=lucene"].getService(Components.interfaces.nsIProtocolHandler); var ss = Components.classes["@mozilla.org/scriptableinputstream;1"].getService(Components.interfaces.nsIScriptableInputStream); var uri = handler.newURI("lucene://index5/search?blah=x&q=foobar&bar=123", null, null); //var uri = handler.newURI("lucene://index5/file/", null, null); var channel = handler.newChannel(uri); var stream = channel.open(); ss.init(stream); while(ss.available() > 0) { print(ss.read(ss.available())); } ss.close(); /* function StreamListener() { this.buff = ""; } StreamListener.prototype.QueryInterface = function(iid) { if(!iid.equals(Components.interfaces.nsISupports) && !iid.equals(Components.interfaces.nsIStreamListener) && !iid.equals(Components.interfaces.nsIRequestObserver)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; } StreamListener.prototype.getBuffer = function() { return this.buff; } StreamListener.prototype.onDataAvailable = function(request, context, inputStream, offset, count) { this.buff = "hello"; } StreamListener.prototype.onStartRequest = function(request, context) { } StreamListener.prototype.onStopRequest = function(request, context, statusCode) { } */