https://github.com/Ralt/chrome-native-messaging.git
git clone 'https://github.com/Ralt/chrome-native-messaging.git'
(ql:quickload :chrome-native-messaging)
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: read-from-ext
and send-to-ext
.
read-from-ext
(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 jsown
package to parse the JSON):
(let* ((buffer (chromium-native-messaging:read-from-ext *standard-input*))
(json-object (jsown:parse buffer)))
; code
)
send-to-ext
(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 jsown
package):
(chrome-native-messaging:send-to-ext
(jsown:to-json
(jsown:new-js
("foo" "bar")))
*standard-output*)
MIT license.