Hello,trying to convert from NPAPI to Native Messaging I have encountered some problems.
Basically this is what i am doing:
- Extension starts the connection to natives messaging host(.exe ,written in c++) from background page,when the page loads
- Native messaging host has a while loop and is supposed to read messages from stdin
What happens is ,when the page loads the port connects and disconnects very fast(lastError is Error when communicating with the native messaging host.) and the host receives EOF directly.However,if when the background page loads I send some data to the messaging host via postMessage the host receives the data but disconnects after a few messages,same error ,the host receives EOF.This number of 'tries' is variable ,even when i test it with the same data sent.
Another problem,not quite important(I managed to find a workaround,not so good) is downloading a file from the native host(for Windows) breaks the connection.I am using the WinApi function UrlDownloadToFile.