Native messaging host not starting when opening Chrome

specified native messaging host not found.
chrome native messaging c#
failed to start native messaging host
access to the specified native messaging host is forbidden.
unchecked runtime.lasterror: native host has exited.
apn native messaging host
native messaging host for remote host management
edge native messaging

I am trying to make a page-action extension that will communicate with a native messaging host (that is an EXE file).

I have installed my extension and I see its UI working as expected, but the EXE is not started. Do I need to do something myself to start it apart from that? :

port = chrome.runtime.connectNative(hostName);

I have installed the host in the registry like so:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.google.chrome.example.echo] @="C:\Users\me\Desktop\nativeMessaging\host\com.google.chrome.example.echo-win.json"

(I have also added this manually because there seemed to be a mess with the x86 and x64 bit version hives...)

Host Manifest file:

{
  "name": "com.google.chrome.example.echo",
  "description": "Chrome Native Messaging API Example Host",
  "path": "native-messaging-example-host.bat",
  "type": "stdio",
  "allowed_origins": [
    "chrome-extension://knldjmfmopnpolahpmmgbagdohdnhkik/",
    "*"
  ]
}

Inside native-messaging-example-host.bat I have the :

MyExeName.exe

As you can see, I have added a "*" in allowed_origins JUST IN CASE the other option was not right for page actions.

I have also tried to put the EXE name directly inside the manifest file, but again with no luck.

I still get a :

Specified native messaging host not found. 

I also check with ProccessExplorer to see what apps Chrome loads, just in case it gets loaded, but I don't see it there either.

The weird things is that I have started modifying the native messaging host sample from Google and I think it was working as an app. It stopped working when I turned it into a page action extension.

Does anyone have any idea what is wrong here?

I had a similar issue. Enabling logging did not help. Turned out to be in my registry key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts

I had quotes around the EXE and path, e.g. "C:\Temp\Chrome\ChromeNativeApp.exe" vs. C:\Temp\Chrome\ChromeNativeApp.exe

So, Can you tell me why my app not worked with chrome 64 bit in win 7 64bit? How can i fix it? OR How can i check permissions to execute my native host? I created an XPC service to communicate some of sandboxed macOS apps(all embedded with the XPC Service). I also tried exporting the service as a standalone and was able to communicate with another

Aside from turning on logging, you can also take the approach of using procmon from sysinternals. It is like regmon and filemon in one, so you can follow chrome query the registry keys, then read the manifest, then run the executable and you can see where it goes wrong.

I had an issue previously, the exe would not run, and by doing the above, I found there was a small typo in the key, that I had missed.

For enabling logging, look at the following: https://www.chromium.org/for-testers/enable-logging e.g. you can start your browser with following command line arguments: --vmodule=extension_updater=2 --enable-logging

1. inside the native messaging host json config file; in this case, on Windows ONLY, you can use https://code.google.com/p/chromium/issues/detail?id=​321628 Then you would launch it in your extension code like this:. According to the Chrome Native Messaging docs a successful call to connectNative() returns a port, with which you can post messages to a native app (a Mac app). In my case nativeConnect() does return a valid port in my case, but a call to onDisconnected() listener is fired almost immediately.

I had similar problem: chrome was creating the port, but not starting the program. Tracing with Sysinternals procmon.exe I found that activity stalls with call to C:\Programs\TCCLE\tcc.exe. I use Take Command as cmd.exe replacement and environment variable ComSpec was set to C:\Programs\TCCLE\tcc.exe; I changed ComSpec back to C:\WINDOWS\system32\cmd.exe and the program started.

Chrome starts the host in a separate process and communicates with it using <​p>The native messaging host manifest file must be valid JSON and contains the Wildcards such as <code>chrome-extension://*/*</code> are <em>not</em>. When a message is sent using runtime.sendNativeMessage in Chrome, without creating a messaging port, Chrome starts a new native messaging host process for each message. The first message generated by the host process is handled as a response to the original request, and all other messages after it are ignored.

I had a similar problem. And nothing here helped. What made the problem go away was changing the name of the host from "com.me.DbServer" to "com.me.test". This change made everything suddenly work. I guess that either DbServer is a reserved name or more likely that uppercase letters are not allowed. I am using Chrome 69.

Native messaging difference from the Chrome documentation. The native messaging host manifest file must be valid JSON and The name must not start or end with a dot, and a dot must not be followed by another dot. After that the extension can exchange JSON messages with the native application using a set of functions in the runtime API. On the native app side, messages are received using standard input (stdin) and sent using standard output (stdout). Support for native messaging in extensions is mostly compatible with Chrome, with two main differences:

With this announcement, Microsoft is no longer accepting new For Chrome native messaging host registration, your app needs to install a manifest The manifest specifies the .exe that Chrome will launch in a sandbox, and  Specified native messaging host not found. I also check with ProccessExplorer to see what apps Chrome loads, just in case it gets loaded, but I don't see it there either. The weird things is that I have started modifying the native messaging host sample from Google and I think it was working as an app.

Native messaging enables an extension to exchange messages with a native Along with the native application itself, you'll need to provide a JSON file called the "host manifest" or "app Note: Chrome does not support the browser_specific_settings key. On startup, connect to the "ping_pong" app. Some apps might stop Chrome from working properly. On your computer, open Chrome. At the top right, click More Settings. At the bottom, click Advanced. Under "Reset and clean up," click Update or

browserpass not working ("Error: Specified native messaging host not found.") #​50425. Closed. simendsjo opened this issue on Nov 15, 2018 · 6 comments https://github.com/browserpass/browserpass#installing-the-chrome-extension  Native messaging. Extensions and apps can exchange messages with native applications that are registered as a native messaging host. To learn more about this feature, see Native messaging. Security considerations Content scripts are less trustworthy

Comments
  • You cannot have wildcards in allowed_origins. "Specified native messaging host not found." is a generic error. What do you see if you look in stderr of Chrome? See e.g. chromium.org/for-testers/enable-logging
  • Thanks! After trying enable-logging and going through its logs, I have found two errors (one extra comma in the JSON and the unsupported wild-cards that you've mentioned). Now it seems working!
  • Now I get a: Error when communicating with the native messaging host. which seems easier to fix - I think.
  • Windows batch scripting is not exactly a suitable (scripting) language for native messaging... Try C, C++, C#, Python or any other language, but not windows batch.
  • Yes, the BAT was only for testing purposes. I have a C++ app now and I am trying to get the response from the host right, following this topic: stackoverflow.com/questions/24775096/…. Thanks for your helpfull answer there too. :)