This blog post mentions as - https://blog.mozilla.org/addons/2016/06/09/webextensions-for-firefox-49/
Read the runtime.connectNative section. They speak:
runtime.connectNative
This API allows you to interact with other processes in the host operating system. It is a widely used API for password managers and security software that needs to communicate with external processes.
To communicate with your own process, this is a two-step process. First, your installer needs to install the JSON manifest file in the appropriate location on the target computer. This JSON manifest provides the link between Firefox and the process. Secondly, the user installs the add-in. Then the add-in can call connectNative, sendNativeMessage and other APIs:
chrome.runtime.sendNativeMessage('your-application', { text: "Hello" }, function(response) { console.log("Received " + response); });
Firefox will start the process if it has not already started, and passes the commands to the process. Follow along with runtime.connectnative's progress in bugzilla.
source share