Web Bluetooth getDevices()

Chrome's implementation of Web Bluetooth does not have a way for websites to get a list of permitted devices. This feature adds the Bluetooth.getDevices() method. getDevices() will return a list of BluetoothDevice objects that the current origin has been granted permission to use by the user.

Motivation

Not being able to query for a list of permitted devices without having to display a permission prompt has been a pain point of using the Web Bluetooth API. Instead, a site has to call navigator.bluetooth.requestDevice() and have the user choose a device from the device chooser prompt on every visit to the page. This is also annoying for users who have to deal with a permission prompt on every visit to the site. This is even more frustrating if the user has multiple Bluetooth devices to connect because the prompt can only grant permission to one device at a time.

Demo

Documentation

Specification

Editor's draft

Status in Chromium

Blink>Bluetooth


In developer trial (Behind a flag) (tracking bug) in:

  • Chrome for desktop release 85
  • Chrome for Android release 85

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

Owner

Intent to Prototype url

Intent to Prototype thread

Comments

Developer Guide: https://docs.google.com/document/d/1RF4D-60cQJWR1LoQeLBxxigrxJwYS8nLOE0qWmBF1eo

Search tags

Web Bluetooth, getDevices,

Last updated on 2020-10-25