{"id":21293212,"url":"https://github.com/guest271314/native-messaging-webassembly","last_synced_at":"2025-07-11T16:32:32.087Z","repository":{"id":70020721,"uuid":"591824892","full_name":"guest271314/native-messaging-webassembly","owner":"guest271314","description":"WebAssembly Native Messaging host","archived":false,"fork":false,"pushed_at":"2024-08-10T20:44:10.000Z","size":760,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-08-11T19:14:13.279Z","etag":null,"topics":["native-messaging","native-messaging-host","webassembly"],"latest_commit_sha":null,"homepage":"","language":"WebAssembly","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":"2023-01-22T01:26:28.000Z","updated_at":"2024-08-10T20:44:13.000Z","dependencies_parsed_at":"2023-11-21T04:28:42.855Z","dependency_job_id":"f28db35f-86a4-4925-8534-637e07eaf7cb","html_url":"https://github.com/guest271314/native-messaging-webassembly","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guest271314%2Fnative-messaging-webassembly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guest271314%2Fnative-messaging-webassembly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guest271314%2Fnative-messaging-webassembly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guest271314%2Fnative-messaging-webassembly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guest271314","download_url":"https://codeload.github.com/guest271314/native-messaging-webassembly/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225741166,"owners_count":17516895,"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":["native-messaging","native-messaging-host","webassembly"],"created_at":"2024-11-21T13:53:45.833Z","updated_at":"2024-11-21T13:53:47.321Z","avatar_url":"https://github.com/guest271314.png","language":"WebAssembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"WebAssembly Native Messaging host\n\nInstallation and usage on Chrome and Chromium\n\n1. Compile `nm_c.c` to WASM \n\n```\n$ git clone https://github.com/guest271314/native-messaging-webassembly\n$ cd native-messaging-webassembly\n$ /path/to/wasi-sdk-19.0/bin/clang nm_c.c -o nm_c.wasm\n```\nor compile `nm_javy.js` to WASM using [`javy`](https://github.com/bytecodealliance/javy) \n\n```\njavy compile nm_javy.js -o nm_javy.wasm\n```\n\nOptionally optimize with \n\n```\nwasmtime compile --optimize opt-level=s nm_javy.wasm\n```\n\nand adjust the path in `nm_javy_wasm.sh` to `nm_javy.cwasm`\n\n2. Download and save `wasmtime` executable to the extension directory.\n3. Navigate to `chrome://extensions`.\n4. Toggle `Developer mode`.\n5. Click `Load unpacked`.\n6. Select native-messaging-webassembly folder.\n7. Note the generated extension ID.\n8. Open `nm_wasm.json` in a text editor, set `\"path\"` to absolute path of `nm_c_wasm.sh`, `nm_c_wat.sh`, or `nm_javy_wasm.sh` and `chrome-extension://\u003cID\u003e/` using ID from 7 in `\"allowed_origins\"` array. \n9. 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`.\n10. Make sure `*.sh` files are executable executable; for WAT embedded in `nm_c_wat.sh` we use `kill_wasmtime.sh` to terminate `wasmtime` using polling of `nm_c_wat.sh` because process substitution keeps `wasmtime` running after the Native Messaging host is disconnected and exits.\n11. 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 WASI Native Messaging host. To disconnect run `port.disconnect()`.\n\nThe Native Messaging host echoes back the message passed. \n\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-webassembly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguest271314%2Fnative-messaging-webassembly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguest271314%2Fnative-messaging-webassembly/lists"}