我的平台操作系统是 win 7。我开始编写扩展程序并尝试与 C++ 应用程序通信。这是我的应用程序的清单:(xxx 是我的扩展 ID)
{
"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\Google\Chrome\NativeMessagingHosts: "com.google.chrome.testc: D:\testC\debug\manifest.json"
但是当扩展名为“chrome.runtime.sendNativeMessage('com.google.chrome.testc', ...)”时,它总是报告“找不到指定的本机消息传递主机。”。
我错过了哪一步?或者上面有什么问题?谢谢。