3 ms·
There's some detailed documentation here https://developer.chrome.com/extensions/nativeMessaging https://developer.chrome.com/extensions/nativeMessaging and a s
by onion2k 11y ago
There's some detailed documentation here https://developer.chrome.com/extensions/nativeMessaging https://developer.chrome.com/extensions/nativeMessaging and a sample app (for Chromium) here https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/docs/examples/api/nativeMessaging https://chromium.googlesource.com/chromium/src/+/master/chro...
Essentially you need to add a native messaging app manifest to Chrome to tell it about the app on the host, and then Chrome reads that JSON file to find where to execute it, what to use to talk to it (eg stdio), what it's called, etc. On Windows the location of the JSON file has to be added to the registry (which is prohibitively annoying), but on OSX and Linux it's just saved in a specific folder. Once you've done that it's a simple case of calling a method on the chrome.runtime object, or setting up a couple of listeners to actually make the call.