A package to communicate with a Chrome extension as the native application
Communicate with Chromium or Google Chrome extensions, as a native application.
For more information on what I mean, please look at nativeMessaging documentation.
This package provides 2 functions:
(defun read-from-ext (stream) "Reads the string sent from the extension. The stream is usually *standard-input*.")
A typical call to this function looks like this (using the
package to parse the JSON):
(let* ((buffer (chromium-native-messaging:read-from-ext *standard-input*)) (json-object (jsown:parse buffer))) ; code )
(defun send-to-ext (string output-stream) "Sends a string to the extension. Usually, output-stream is *standard-output*.")
A typical call looks like this (again, using the
(chrome-native-messaging:send-to-ext (jsown:to-json (jsown:new-js ("foo" "bar"))) *standard-output*)