runtime.sendNativeMessage()

Send a single message to a native application.

Syntax

browser.runtime.sendNativeMessage(
  application,             // string
  message,                 // object
  function(response) {...} // optional function
)

Parameters

application
string. The name of the native messaging host.
message
object. The message that will be passed to the native messaging host.
responseCallbackOptional
function. The function is passed the following arguments:
response
any. The response message sent by the native messaging host. If an error occurs while connecting to the native messaging host, the callback will be called with no arguments and runtime.lastError will be set to the error message.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?NoYes33
Firefox
Basic supportNo

Examples

Acknowledgements

This API is based on Chromium's chrome.runtime API. This documentation is derived from runtime.json in the Chromium code.

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,