Hi,
I’m currentlty migrating a legacy addon to new WebExtension design.
We are using native messaging towards an application written in C.
I started my project from the ‘ping pong’ example from GitHub.
I replaced the Python script by our C application.
I have no problem to get message from WebExtension -> C app.
The problem arises when sending back response from C app to WebExtension.
Actually when testing, I see in the console ‘Sending: ping’ but not ‘Received: pong’
Here is the snippet code of C application for response:
========== Code ====================
char responseBuf[64] = { 0 };
unsigned int responseLen;
…
…
/* sending json response to the WebExtension */
strcpy(responseBuf, ““pong””);
responseLen = strlen(responseBuf);
fwrite(&responseLen, 1, 4, stdout);
fwrite(responseBuf, 1, responseLen, stdout);
fflush(stdout);
May I missed something on response making ?
Any help would be appreciated, because I have been stuck for days on this problem.
Thanks.