Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guest271314/native-messaging-bun
Bun Native Messaging host
https://github.com/guest271314/native-messaging-bun
bun javascript native-messaging native-messaging-host
Last synced: about 1 month ago
JSON representation
Bun Native Messaging host
- Host: GitHub
- URL: https://github.com/guest271314/native-messaging-bun
- Owner: guest271314
- License: wtfpl
- Created: 2023-01-08T01:05:52.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-03T14:22:44.000Z (about 2 months ago)
- Last Synced: 2024-11-03T15:24:25.614Z (about 2 months ago)
- Topics: bun, javascript, native-messaging, native-messaging-host
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Bun 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-bun` folder.
5. Note the generated extension ID.
6. Open `nm_bun.json` in a text editor, set `"path"` to absolute path of `nm_bun.js` and `chrome-extension:///` 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`.
8. Make sure `bun` executable and `nm_bun.js` are executable.
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 Bun Native Messaging host. To disconnect run `port.disconnect()`.The Native Messaging host echoes back the message passed.
For differences between OS and browser implementations see [Chrome incompatibilities](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Chrome_incompatibilities#native_messaging).
# License
Do What the Fuck You Want to Public License [WTFPLv2](http://www.wtfpl.net/about/)