javascript - Chrome : Native messaging Error: Access to the specified native messaging host is forbidden

标签 javascript google-chrome google-chrome-extension chrome-native-messaging

我正在运行 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/

相关文章:

javascript - 在 iPad 上使用 jQuery UI Draggable 和 jQuery Touch Punch 滚动列表无法正常工作

javascript - 带有 javascript 的简单搜索引擎。有什么建议吗?

javascript - 可编辑表格单元格的 Jeditable 替代方案

javascript - 类型 'userAgentData' 上不存在属性 'Navigator'

css - 带有 webpack style-loader 的 Chrome 扩展找不到样式目标

javascript - 如何用js将<svg>标签改为<img>标签?

javascript - Chrome 扩展上下文菜单不存在

javascript - 如何使用 Javascript 更改 3rd Div backgroundColor

jquery - 如何修复 Chrome 中的页面滚动延迟

javascript - 按应用程序模式从扩展程序运行网页或本地页面