My platform OS is win 7. I started to write extension and try to communicate with C++ app. Here is manifest of my app: (xxx is my extension id)

{
  "name": "com.google.chrome.testc",
  "path": "D:\\testC\\debug\\testC.exe",
  "description": "My Application",
  "type": "stdio",
  "allowed_origins": [
  "chrome-extension://xxx/"
  ]
}

And I also add registry key at: HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts: "com.google.chrome.testc: D:\testC\debug\manifest.json"

But when extension called "chrome.runtime.sendNativeMessage('com.google.chrome.testc', ...)", it always report "Specified native messaging host not found.".

What step I missed? or something wrong above? Thanks.

有帮助吗?

解决方案

The registry key should be HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.my_company.my_application, and it's (Default) value should be D:\testC\debug\manifest.json.

From your description it seems that you are instead adding a string value with name com.my_company.my_application under the key HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top