QuickJS Native Messaging host
Installation and usage on Chrome and Chromium
- Navigate to
chrome://extensions
. - Toggle
Developer mode
. - Click
Load unpacked
. - Select native-messaging-quickjs folder.
- Note the generated extension ID.
- Open
nm_qjs.json
in a text editor, set"path"
to absolute path ofnm_qjs.js
andchrome-extension://<ID>/
using ID from 5 in"allowed_origins"
array. - Copy the
nm_qjs.json
file to Chrome or Chromium configuration folder, e.g., Chromium on *nix~/.config/chromium/NativeMessagingHosts
; Chrome dev channel on *nix~/.config/google-chrome-unstable/NativeMessagingHosts
. - Make sure
qjs
executable andnm_qjs.js
are executable. - To test click
service worker
link in panel of unpacked extension which is DevTools forbackground.js
in MV3ServiceWorker
, observe echo'ed message from txiki.js Native Messaging host. To disconnect runport.disconnect()
.
The Native Messaging host echoes back the message passed.
For differences between OS and browser implementations see Chrome incompatibilities.
This is FOSS. If you think a license is necessary consider WTFPLv2 applicable.