Skip to content

Amazon Web Services - Labs LLRT (Low Latency Runtime) Native Messaging host

License

Notifications You must be signed in to change notification settings

guest271314/native-messaging-llrt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Amazon Web Services - Labs LLRT (Low Latency Runtime) Native Messaging host

Installation and usage on Chrome and Chromium

  1. Navigate to chrome://extensions.

  2. Toggle Developer mode.

  3. Click Load unpacked.

  4. Select native-messaging-llrt folder.

  5. Note the generated extension ID.

  6. Open nm_llrt.json in a text editor, set "path" to absolute path of nm_llrt.js and chrome-extension://<ID>/ using ID from 5 in "allowed_origins" array.

  7. 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; and similar for Chrome For Testing.

  8. Make sure nm_llrt.js is executable. See Notes for why Bash or QuickJS are used to read standard input stream to llrt.

  9. To test click service worker link in panel of unpacked extension which is DevTools for background.js in MV3 ServiceWorker, observe echo'ed message from llrt Native Messaging host. The communication mechanism can be extended to run llrt from any arbitrary Web page using various means, including, but not limited to utilizing "externally_connectable" to message to and from the ServiceWorker on specific Web pages over IPC; "web_accessible_resources" to append an extension iframe to any document and use postMessage() to transfer messages between browsing contexts; an offscreen document or side-panel document to connect to the host and transfer messages back and forth to the arbitrary Web page in the browser, et al.

Notes

Standard input and standard output are not specified by ECMA-262.

There does not appear to be a straigtforward way to read standard input to llrt.

We use pgrep command to get the PID of the current process, then or GNU Coreutils head, dd command, or QuickJS to read /proc/$@/fd/0, then echo the STDIN to the current llrt process to llrt.

Compatibility

For differences between OS and browser implementations see Chrome incompatibilities.

License

Do What the Fuck You Want to Public License WTFPLv2

About

Amazon Web Services - Labs LLRT (Low Latency Runtime) Native Messaging host

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published