Web Bluetooth Updates

Web Bluetooth, the mechanism by which web sites can access Bluetooth devices, has been updated to make it easier for end users.

The main changes are two new experimental function calls getDevices() and watchAdvertisements(). Previously, permission prompts have been a pain point using the Web Bluetooth API with users having to ok the permission prompt on every visit to the site. This is especially troublesome when there are many Bluetooth devices as each permission has to be granted one device at a time. Bluetooth.getDevices() method returns a list of Bluetooth device that have already been granted by the user. The Bluetooth.watchAdvertisements() function allows observing when device is in range and broadcasting advertisement packets.

Being experimental, these new features are currently hidden behind Chrome flags:

The APIs are behind the
chrome://flags/#enable-experimental-web-platform-features
chrome flag and persistent device permissions are behind the chrome://flags/#enable-web-bluetooth-new-permissions-backend
flag that exposes the Bluetooth devices a device is allowed to access.

There is more information on the getDevices() Chrome flag and documentation.