Chrome Native Messaging Example

Stefan
1 min readAug 11, 2016

This article contains an example extension that uses native messaging to communicate with a (Delphi-made) Windows executable that serves as a native messaging host.

Click here for more info on Chrome Native Messaging.

Install the sample extension

  1. Download the sample extension here.
  2. Start Google Chrome
  3. Click on Chrome’s hamburger icon, then click on: Tools > Extensions
  4. Make sure the check box labelled Developer mode is ON
  5. Click on: Load unpacked extension…
  6. Select the extension directory.

Install the sample host

  1. Download the sample host here.
  2. Double-click on install_host.bat (should Windows prevent this from starting, then click on More info and then Run anyway)

Start the sample

  1. Start Google Chrome
  2. Enter this into the navigation bar:
chrome-extension://knldjmfmopnpolahpmmgbagdohdnhkik/main.html

3. Click on Connect

4. From here, you should be able to send (and receive) messages from the host

Source code

--

--

Stefan

Delphi/Rust/Go developer. Ethereum consultant. Embarcadero MVP. Ex-Adobe, Macromedia. Helped build 1Password.