{"id":21293218,"url":"https://github.com/guest271314/native-messaging-d8","last_synced_at":"2026-05-19T01:33:29.926Z","repository":{"id":245402125,"uuid":"818140931","full_name":"guest271314/native-messaging-d8","owner":"guest271314","description":"d8 Native Messaging host","archived":false,"fork":false,"pushed_at":"2024-07-25T07:25:29.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T06:46:34.512Z","etag":null,"topics":["d8","javascript","native-messaging","native-messaging-host","shell","v8"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guest271314.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-21T07:28:51.000Z","updated_at":"2024-07-25T07:25:32.000Z","dependencies_parsed_at":"2024-06-22T01:07:24.909Z","dependency_job_id":"76614023-3d71-4489-9a66-30bb025ba18a","html_url":"https://github.com/guest271314/native-messaging-d8","commit_stats":null,"previous_names":["guest271314/native-messaging-d8"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guest271314%2Fnative-messaging-d8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guest271314%2Fnative-messaging-d8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guest271314%2Fnative-messaging-d8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guest271314%2Fnative-messaging-d8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guest271314","download_url":"https://codeload.github.com/guest271314/native-messaging-d8/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243762236,"owners_count":20343976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["d8","javascript","native-messaging","native-messaging-host","shell","v8"],"created_at":"2024-11-21T13:53:45.933Z","updated_at":"2026-05-19T01:33:24.888Z","avatar_url":"https://github.com/guest271314.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"d8 Native Messaging Host\n\nInstallation and usage on Chrome and Chromium\n\n1. Navigate to `chrome://extensions`.\n2. Toggle `Developer mode`.\n3. Click `Load unpacked`.\n4. Select `native-messaging-d8` folder.\n5. Note the generated extension ID.\n6. Open `nm_d8.json` in a text editor, set `\"path\"` to absolute path of `nm_d8.js` and `chrome-extension://\u003cID\u003e/` using ID from 5 in `\"allowed_origins\"` array. \n7. 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.\n8. Make sure `nm_d8.js` is executable. See [Notes](https://github.com/guest271314/native-messaging-d8#notes) for why Bash is used to read standard input stream to `d8`. To download V8 using [`jsvu`](https://github.com/GoogleChromeLabs/jsvu) or [`esvu`](https://github.com/devsnek/esvu)\n\n```\nbun install jsvu\n./node_modules/.bin/jsvu --os=linux64 --engines=v8\n```\n```\nbun install esvu\n./node_modules/.bin/esvu install v8\n```\nand use the appropriate path to the `v8` executable\n\n```\n#!/usr/bin/env -S /home/user/.jsvu/engines/v8/v8\n```\n```\n#!/usr/bin/env -S /home/user/.esvu/engines/v8/d8\n```\n\n9. 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 `d8` Native Messaging host. The communication mechanism can be extended to run V8 via `d8` 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.\n\n### Notes\n\n[d8](https://v8.dev/docs/d8) (\"V8’s own developer shell\") does not expect to be used as a Native Messaging host. \n\nStandard input and standard output are not specified by ECMA-262. \n\nV8 maintainers do not currently appear to be interested in extending `d8` capabilities, or the idea of standardizing reading STDIN for JavaScript. See [Implement reading STDIN to an ArrayBuffer. Precedent: `writeFile(\"/proc/self/fd/1\")`](https://groups.google.com/g/v8-users/c/NsnStT6bx3Y/m/Yr_Z1FwgAQAJ)\n\nWe work around this in the `d8` shell by using [`os.system()`](https://source.chromium.org/chromium/chromium/src/+/main:v8/src/d8/d8.h;l=647) with [`pgrep`](https://man7.org/linux/man-pages/man1/pgrep.1.html) command to get the PID of the current process, then or GNU Coreutils [`head`](https://www.gnu.org/software/coreutils/manual/html_node/head-invocation.html),\n[`dd`](https://www.gnu.org/software/coreutils/manual/html_node/dd-invocation.html#dd-invocation) command, or [QuickJS](https://bellard.org/quickjs/quickjs.html) to read `/proc/$@/fd/0`, then echo the STDIN to the current `d8` process to `d8`. \n\n### Compatibility\n\nFor differences between OS and browser implementations see [Chrome incompatibilities](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Chrome_incompatibilities#native_messaging).\n\n# License\nDo What the Fuck You Want to Public License [WTFPLv2](http://www.wtfpl.net/about/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguest271314%2Fnative-messaging-d8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguest271314%2Fnative-messaging-d8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguest271314%2Fnative-messaging-d8/lists"}