0
是否可以在浏览器刷新时保持蓝牙LE连接?或者至少减少配对时间?是否可以在浏览器刷新时保持蓝牙LE连接
是否可以在浏览器刷新时保持蓝牙LE连接?或者至少减少配对时间?是否可以在浏览器刷新时保持蓝牙LE连接
最后navigator.permissions.query会支持这个。来自Web Bluetooth Specification的示例代码
navigator.permissions.query({
name: "bluetooth",
deviceId: sessionStorage.lastDevice,
}).then(result => {
if (result.devices.length == 1) {
return result.devices[0];
} else {
throw new DOMException("Lost permission", "NotFoundError");
}
}).then(...);
但是,no browser currently implements this。
从Q3 2017开始,铬的实现在积极地处理Web蓝牙,但没有这个功能。
我甚至不知道你可以使用蓝牙进行网络开发,但是有可能将连接的某些方面保存到本地存储? – Carcigenicate