【问题标题】:Connect to a paired device without user permission in Chrome web bluetooth API?在 Chrome 网络蓝牙 API 中未经用户许可连接到配对设备?
【发布时间】:2020-06-23 07:56:22
【问题描述】:

通过使用 API navigator.bluetooth.requestDevice(),网页可以请求用户允许他与蓝牙设备配对并建立连接。批准请求后,假设用户重新加载网页。有没有办法让网络连接到该配对设备而无需再次请求许可?

我知道我们可以在 web-usb 中使用 API navigator.usb.getDevices() 做到这一点,但我找不到在 web-bluetooth 中做到这一点的方法。请任何人帮忙。

谢谢

【问题讨论】:

    标签: javascript google-chrome web-bluetooth webusb


    【解决方案1】:

    Web Bluetooth specification 提到 navigator.permissions.query() 方法可用于请求在页面重新加载之前已授予权限的 BluetoothDevice 对象。

    但是,Chrome 目前没有像 WebUSB 那样实现持久的 Web 蓝牙权限,也没有通过 navigator.permission API 实现查询 Web 蓝牙权限。这两个任务都由issue 577953跟踪。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-05-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-26
      • 1970-01-01
      • 2016-06-08
      相关资源
      最近更新 更多