nsIScriptableInputStream accesses data with exception ESR 68

Talk about add-ons and extension development.
Posts: 1
Joined: November 4th, 2019, 8:00 pm

Post Posted November 4th, 2019, 8:15 pm

Hi team,
I met data receiving exception with nsIScriptableInputStream and socket-transport-service against FF ESR 68.
socket-transport-service can SEND message successfully, but exception when access stream with nsIScriptableInputStream.
We use socket-transport-service to communicate between windows service and FF extension, nsIScriptableInputStream to read stream.
It is XPCOM technology, not available in latest FF, but It's large amount of work for us to port web extension, we need long time to finish it, is there any workaround?

Is there any workaround for that issue or replacement solution?
Thank you!

Exception detail:
message: "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) []"
result: 2147500033
stack: "propertyValue@resource://devtools/server/actors/object.js:586:18\nhandler@resource://devtools/shared/protocol.js:1221:37\nonPacket@resource://devtools/server/main.js:1395:58\nsend/<@resource://devtools/shared/transport/local-transport.js:70:25\nexports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:111:22\nexports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:111:22\n"

Source code:
Code: Select all
var port = 7979;
var transportService = Components.classes[";1"].getService(Components.interfaces.nsISocketTransportService);
var transport = transportService.createTransport([], 0, ‘localhost’, port, null);
// output stream works!
var osTemp = transport.openOutputStream(1,512,0);
var osConverter = Components.classes[";1"].createInstance(Components.interfaces.nsIConverterOutputStream);
osConverter.init(osTemp, “utf8”, 512, null);

// input stream fails!
var stream = transport.openInputStream(0,0,0);
var instream = Components.classes[";1"].createInstance(Components.interfaces.nsIScriptableInputStream);
var dataListener = {
converter: Components.classes[""]
data : “”,
onStartRequest: function(request, context){console.log(“START DATA REQUEST…”);},
onStopRequest: function(request, context, status){
console.log(“STATUS:” + status);

onDataAvailable: function(request, context, inputStream, offset, count){
this.converter.charset = “utf8”;
console.log(“COUNT: " + count); +=;
var i =”\r\n");

while (i >= 0) {
   var message =, i);
   message = this.converter.ConvertToUnicode(message);
   console.log(message); = + 2,;
   i ="\r\n");

var pump = Components.classes[";1"].createInstance(Components.interfaces.nsIInputStreamPump);
pump.init(stream, 0, 0, true);

Return to Extension Development

Who is online

Users browsing this forum: No registered users and 1 guest