Problem with porting WebExt with NativeMessaging: No such native application

I have a problem with porting WebExtension from Google Chrome to Firefox for Windows.
What i did (https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging):

  1. modify extension manifest:
    1.1) add section application for adding extension id and strict version
  2. modify Native App manifest:
    2.1) change section “allowed_origins” on “allowed_extensions”
  3. register Native App manifest in Win Registry (HKU\SOFTWARE\Google\Chrome\NativeMessagingHosts)

When I call chrome.runtime.connectNative(<app_name>) from backgound script, callback onDisconnect receive error “No such native application <app_name>”.

I tried run exemple ping_pong (https://github.com/mdn/webextensions-examples/tree/master/native-messaging), but got same error.

OS: Windows 10 Enterprise
Firefox version: 57.0.1 (64-bit)

Could you help me with solve this problem?

If you want it to work with Firefox, you should not only register it for Chome. Firefox uses:
HKCU\Software\Mozilla\NativeMessagingHosts\<name>

modify Native App manifest

I think you have to create a second manifest file.

1 Like

Thanks @NilkasG, we found your statement on the manifest file to be true.

We could not reuse our Chrome native host manifest file and simply add “allowed_extensions”: “{ID-lorem-ip-sum}”.
We had to create a second manifest file for Firefox only.