Clarification about what a native application is in runtime.sendNativeMessage

Hi,
The documentation of runtime.sendNativeMessage() states

Sends a single message from an extension to a native application.

Does that mean that I can e.g. send a message to a Qt application ? If so, how is the message to be handled in such a “native application” ?

Thanks for clarifying this!

The “further info” article linked provides details on the protocol: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging#Exchanging_messages

1 Like

Thanks for the link!
I read that before, but was hoping there would maybe be another way to exchange
info between the background script and the Qt application than using stdin and stdout.

I think I will try by writing a cookie file with the info, and then let my Qt app react to changes to that file (modification time) to read the info.

If you know of a smarter way, please let me know^^

You can alternatively also use a WebSocket, for example. However establishing authenticity is more complicated in that case.

Hi Martin,
You’re absolutely right. I just tested the WebSocket method and it is of course much better than what I initially was trying to do.
Thank you again!