-->

Chrome扩展本地消息得到了错误:“指定的本地消息主机没有找到。”(Chrome extensio

2019-10-19 05:51发布

我的OS平台是赢得7.我开始写扩展,并尝试与C ++应用程序进行通信。 这是明显的我的应用程序:(xxx是我的分机号)

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

我还添加注册表键的位置:HKEY_LOCAL_MACHINE \ SOFTWARE \谷歌\镀铬\ NativeMessagingHosts: “com.google.chrome.testc:d:\ TESTC \调试\的manifest.json”

但是,当扩展名为“chrome.runtime.sendNativeMessage(‘com.google.chrome.testc’,...)”,它总是报告“指定的本地消息主机没有找到。”

我错过了哪一步? 或者什么不对以上? 谢谢。

Answer 1:

该注册表项应该是HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.my_company.my_application ,和它的(Default)值应为D:\testC\debug\manifest.json

从你的描述看来,你是不是将与名称的字符串值com.my_company.my_application下键HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts



文章来源: Chrome extension native messaging got error:“Specified native messaging host not found.”