nsIScriptableInputStream accesses data with exception ESR 68
Categories
(Core :: Networking, defect)
Tracking
()
People
(Reporter: chhxia1203, Unassigned)
Details
Attachments
(1 file)
1.89 KB,
text/plain
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36
Steps to reproduce:
Reproduce in FF ESR 68 extension development.
- Create a simple network connection application, listen to a port and return string message after receiving FF message.
- Open firefox browser console for debugging, use nsISocketTransportService to set up messaging with the #1 application, send a simple message to #1 application and out put the returning message.
See the attached source code.
Actual results:
FF throw exception when accessing input data.
Exception detail:
message: "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIBufferedInputStream.data]"
name: "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"
Expected results:
Read input data successfully.
Reproduce in FF ESR 68 extension development.
But your code like a legacy extension, rather than webextensions.
Yes, we are using legacy extension. We are porting it to web extension, need some time to finish.
We found that the socket-transport-service can out put data, no idea why the input fails, is there any workaround?
(In reply to Galia2 from comment #2)
Yes, we are using legacy extension. We are porting it to web extension, need some time to finish.
We found that the socket-transport-service can out put data, no idea why the input fails, is there any workaround?
Not easy to find someone to solve.
Comment 4•5 years ago
|
||
Shouldn't you be using webExtension code to do this kind of stuff?
I'm not sure it's even correct. Not sure who I might direct you to.
var dataListener = {
converter: Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
.createInstance(Components.interfaces.nsIScriptableUnicodeConverter),
data : “”,
onStartRequest: function(request, context){console.log(“START DATA REQUEST…”);},
onStopRequest: function(request, context, status){
console.log(“STATUS:” + status);
},
First off dataListener doesn't implement any interface. Sure, you can pass it to asyncRead
, but if someone calls QueryInterface on it, that'll fail.
message: "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIBufferedInputStream.data]"
name: "NS_ERROR_NOT_IMPLEMENTED"
result: 2147500033
In any case, the error could be coming from here or here
Also, did you notice your code has weird quote symbols? “START DATA REQUEST…”
instead of "START DATA REQUEST…"
.
This would definitely make it fail.
Description
•