我正在运行 native 消息传递示例应用程序。 (http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/nativeMessaging/)。
我已经添加了注册表项
HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.google.chrome.example.echo
当我连接到 native 主机时出现错误:
Failed to connect: Access to the specified native messaging host is forbidden.
最佳答案
根据 the docs 您需要在后者的 list 中明确地授予您的扩展程序访问 NativeMessagingHost 的权限:
"allowed_origins": [
"chrome-extension://<your_extension's_ID>/"
]
关于javascript - Chrome : Native messaging Error: Access to the specified native messaging host is forbidden,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20216224/