Javascript 在JS扩展中使用chrome.bluetooth.AddProfile的权限被拒绝

Javascript 在JS扩展中使用chrome.bluetooth.AddProfile的权限被拒绝,javascript,google-chrome-extension,bluetooth,google-chrome-app,Javascript,Google Chrome Extension,Bluetooth,Google Chrome App,我正在OSX上运行Google Chrome Canary 我正在尝试修改以连接到Android应用程序,该应用程序通过蓝牙在套接字上侦听特定UUID 开发人员示例使用的API与Chrome的更高版本不一致,后者现在基于概要文件 当我试图在Zephyr客户端的main.js中调用chrome.bluetooth.addProfile({uuid:kUUID},console.log)时,我收到以下错误消息: bluetooth.addProfile:添加配置文件的权限被拒绝。 然后是响应blue

我正在OSX上运行Google Chrome Canary

我正在尝试修改以连接到Android应用程序,该应用程序通过蓝牙在套接字上侦听特定UUID

开发人员示例使用的API与Chrome的更高版本不一致,后者现在基于概要文件

当我试图在Zephyr客户端的main.js中调用
chrome.bluetooth.addProfile({uuid:kUUID},console.log)
时,我收到以下错误消息:

bluetooth.addProfile:添加配置文件的权限被拒绝。
然后是响应bluetooth时出现的
错误。addProfile:TypeError:非法调用

如何授予分机呼叫addProfile的权限?manifest.json已提供蓝牙权限

有没有办法在Chrome中全局禁用权限以进行测试


谢谢。

您需要在manifest.json中这样声明蓝牙权限:

"permissions": [
  {
    "bluetooth": [
      {
        uuid: '<Your UUID>'
      }
    ]
  }
  ...
]
“权限”:[
{
“蓝牙”:[
{
uuid:'
}
]
}
...
]

因为它需要是打包的应用程序,而不是扩展。蓝牙无法与分机配合使用。

谢谢。我有:
“权限”:[{“蓝牙”:[{“uuid”:“00001101-0000-1000-8000-00805f9b34fb”}],
并且清单在Chrome中正确加载。但是,我仍然收到相同的错误:
响应bluetooth时出错。addProfile:TypeError:非法调用
。我还是做错了什么吗?console.log不能直接用作回调函数。将其替换为
function(){console.log('ok')}