简体   繁体   中英

Connect to a paired device without user permission in Chrome web bluetooth API?

By using the API navigator.bluetooth.requestDevice(), a web page could ask a user for his permission to pair and establish connection with a bluetooth device. After approving the request, assume the user reloads the web page. Is there a way for the web to connect to that paired device without asking for permission again?

I know we can do that in web-usb with API navigator.usb.getDevices(), but I can not find a way to do that in web-bluetooth. Anyone please help.

Thanks

The Web Bluetooth specification mentions that the navigator.permissions.query() method can be used to request BluetoothDevice objects for which permission was granted prior to a page reload.

However, Chrome does not currently implement persistent Web Bluetooth permissions the way that is done for WebUSB nor does it implement querying Web Bluetooth permissions through the navigator.permission API. Both of these tasks are tracked by issue 577953 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM