edit: it seems my “native” program isn’t working, the official example doesn’t work when it uses my ping_pong implementation. wait until I sort this out.
hey fellas
I’m unable to await the Promise returned by runtime.sendNativeMessage().
is it skill issue, or did I find a bug in Firefox? can you pinpoint my mistake, please?
I’m using Linux. version of Firefox: 153.6.0esr (64-bit)
pls look at my code:
so basically running $ make will install the native app manifest under ~/.mozilla and compile the echo program
I initially followed these two tutorials:
then I adapted my code from second tutorial to apply everything from this tutorial:
the only divergence is as follows. this tutorial on “Native messaging” says this:
Native messaging cannot directly be used in content scripts. You must do it indirectly via background scripts).
however, I call runtime.sendNativeMessage() in a “popup script”, created after following the tutorial “Your second extension”. according to the following page:
All of these are Extension pages. Unlike a normal web page, your extension’s JavaScript can use the same privileged WebExtensions APIs as your background script.
referring to “sidebar”, “popup” and “options”. which means my JavaScript run in the popup should be able to call runtime.sendNativeMessage()
thanks in advance, I’m eager for feedback