Can't get native messaging example to work - Attempt to postMessage on disconnected port

I followed the directions here: for windows

When I click the add ons icon, it says “Error: Attempt to postMessage on disconnected port” in the add ons console (nothing in the normal browser console).

  1. I have python installed, version 3.10
  2. I added python to my PATH
  3. I changed ping_pong.json to point to the bat file
  4. I edited the bat file to point to the python script
  5. I added a registry key with the path to the manifest.json

I triple checked these so I don’t know what’s wrong, and the error message provides no useful information for debugging.

Your registry key is named “Native messaging example”, but it must be named “ping_pong”.

The doesn’t say this explicitly.
It links to Manifest location, where it says:

In all the examples, <name> is the value of the name property in the manifest.

They should probably clarify that they mean the native messaging manifest (ping_pong.json), not the extension manifest (manifest.json).

As for, it just crashes:

key = winreg.OpenKey(getattr(winreg, root), key_path)
FileNotFoundError: [WinError 2] The system could not find the specified file

I changed the name of the registry key while Firefox was running.
It didn’t become aware of the change immediately, I had to reload the extension first.

Ah, yeah I assumed they mean the add-on manifest.

Unfortunately I had also tried “ping_pong”, and just tried it again (rebooted firefox after changing the key, then re-added the temporary add on), and I’m still getting the same error message.

I hadn’t noticed that check_config_win python file before, but upon trying it I get the same error as you did.

Any other ideas?

Oops, just figured it out!

I had “ping_pong.bat” instead of “ping_ping_win.bat” under “ping_pong.json”. Figured it out by using