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