An example that uses wxnm
to have a native application report its process ID to the extension.
- Node 10+
- Yarn
- A compatible browser installed
- Run
yarn
to install node dependencies - Run
yarn build:extension
to build the extension and native app - Install the extension in your browser of choice from
example/extension/dist
- If the browser you added it to is Chrome-based, export the extension ID as an environment variable
> export CHROME_EXTENSION_ID="id"
- If the browser you added it to is Chrome-based, export the extension ID as an environment variable
- Run
yarn build:node
to build the node app - Run the native messaging host installer by running the app with the install flag
./node/dist/wxnm-node-example --install
- Open the extension popup, and see your process ID!
If you run into error messages, see the Chrome native messaging debugging help or the MDN native messaging troubleshooting section.