{"id":21293215,"url":"https://github.com/guest271314/native-messaging-spidermonkey-shell","last_synced_at":"2026-02-27T02:02:50.294Z","repository":{"id":244882720,"uuid":"816559095","full_name":"guest271314/native-messaging-spidermonkey-shell","owner":"guest271314","description":"SpiderMonkey Shell Native Messaging host","archived":false,"fork":false,"pushed_at":"2026-01-12T06:53:00.000Z","size":48,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-12T16:34:31.736Z","etag":null,"topics":["javascript","js","native-messaging","native-messaging-host","shell","spidermonkey"],"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-18T01:50:35.000Z","updated_at":"2026-01-12T06:53:04.000Z","dependencies_parsed_at":"2024-06-26T08:45:17.169Z","dependency_job_id":"fd0d5f45-403d-4ab1-ae0e-07308ed91e63","html_url":"https://github.com/guest271314/native-messaging-spidermonkey-shell","commit_stats":null,"previous_names":["guest271314/native-messaging-spidermonkey-shell"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/guest271314/native-messaging-spidermonkey-shell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guest271314%2Fnative-messaging-spidermonkey-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guest271314%2Fnative-messaging-spidermonkey-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guest271314%2Fnative-messaging-spidermonkey-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guest271314%2Fnative-messaging-spidermonkey-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guest271314","download_url":"https://codeload.github.com/guest271314/native-messaging-spidermonkey-shell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guest271314%2Fnative-messaging-spidermonkey-shell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29882627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"online","status_checked_at":"2026-02-27T02:00:06.759Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","js","native-messaging","native-messaging-host","shell","spidermonkey"],"created_at":"2024-11-21T13:53:45.869Z","updated_at":"2026-02-27T02:02:45.282Z","avatar_url":"https://github.com/guest271314.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"SpiderMonkey JavaScript and WebAssembly engine Shell 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-spidermoney-shell folder.\n5. Note the generated extension ID.\n6. Open `nm_spidermonkey.json` in a text editor, set `\"path\"` to absolute path of `nm_spidermonkey.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_spidermonkey.js` is executable. To download SpiderMonkey shell\n```\nwget --show-progress \\\n--progress=bar \\\n--output-document jsshell.zip \\\nhttps://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/jsshell-linux-x86_64.zip \\\n\u0026\u0026 unzip jsshell.zip \\\n\u0026\u0026 rm jsshell.zip\n```\n\nor using [`jsvu`](https://github.com/GoogleChromeLabs/jsvu)\n\n```\nbun install jsvu\n./node_modules/.bin/jsvu --os=linux64 --engines=spidermonkey\n```\nand use the appropriate path to the `js` or `spidermonkey` executable, respectively in `nm_spidermoney.js`, e.g.,\n\n```\n#!/usr/bin/env -S /home/user/bin/js\n```\nor\n\n```\n#!/usr/bin/env -S /home/user/.jsvu/engines/spidermonkey/spidermonkey\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 SpiderMonkey Native Messaging host. See [Notes](https://github.com/guest271314/native-messaging-spidermonkey-shell/blob/main/README.md#notes).\n\n### Notes\n\n[SpiderMonkey JavaScript/WebAssembly engine](https://spidermonkey.dev/) Shell does not expect to be used as a Native Messaging host. **Standard input and standard output are not specified by ECMA-262**. We have to work around that fact in this `js` shell. \n\nJavaScript *runtimes* tested so far, include QuickJS, txiki.js, Deno, Node.js, Bun. Each process standard input and output differently. With the aforementioned runtimes we can maintain a persistent connection between client and host using [`connectNative()`](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/connectNative). See [NativeMessagingHosts](https://github.com/guest271314/NativeMessagingHosts).\n\nWhile we use `connectNative` here instead of `sendNativeMessage` that is only to send a trailing `\"\\r\\n\\r\\n\"` for `readline()` to stop reading (blocking), echo the message back then call `disconnect()`, repeat for each message, to avoid the `js` shell hanging on subsequent messages from client to host.\n\nFor the above reasons `native-messaging-spidermonkey-shell` will not be added to the working Native Messaging hosts repository listed above until we get this working as intended. \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\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguest271314%2Fnative-messaging-spidermonkey-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguest271314%2Fnative-messaging-spidermonkey-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguest271314%2Fnative-messaging-spidermonkey-shell/lists"}