Deno Native Messaging Host
Installation and usage on Chrome and Chromium
- Navigate to
chrome://extensions
. - Toggle
Developer mode
. - Click
Load unpacked
. - Select native-messaging-deno folder.
- Note the generated extension ID.
- Open
nm_deno.json
in a text editor, set"path"
to absolute path ofnm_deno.js
andchrome-extension://<ID>/
using ID from 5 in"allowed_origins"
array. - Copy the 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
deno
executable andnm_deno.js
are executable. To downloaddeno
executable into the cloned GitHub directory that is used as the local unpacked extension directory (and optionally strip symbolic information from thedeno
executable to reduce size) you can run
wget --show-progress \
--progress=bar \
--output-document deno.zip \
https://github.com/denoland/deno/releases/latest/download/deno-x86_64-unknown-linux-gnu.zip \
&& unzip deno.zip \
&& rm deno.zip \
&& strip deno
- To test click
service worker
link in panel of unpacked extension which is DevTools for background.js in MV3ServiceWorker
, observe echo'ed message Deno 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.
License
Do What the Fuck You Want to Public License WTFPLv2