Contact emails
Design docs/spec
TAG review
Since this change adds an API that already exists in other device APIs, the TAG review process is skipped.
Summary
Chrome's implementation of Web Bluetooth does not have a way for websites to get a list of permitted devices. This feature adds a getDevices() API. 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.
We've had a couple of developers ask for this functionality in the
bug for this feature.
Risks
Interoperability and Compatibility
The Web Bluetooth API as a whole has only been implemented in Chromium, therefore there is high interoperability risk. However, there are 170 tests in Web Platform Tests that other implementers can use.
Firefox: No signals (based on discussion on
standards-positions#95). There were concerns shared with WebUSB and WebMIDI, but ultimately the discussion ended without a distinct signal on the API.
Web / Framework developers: Mostly positive with concerns about security and privacy
- Web Bluetooth API as a whole (see Intent to Ship: Web Bluetooth)
- Mostly positive support on the WebKit bug
- Privacy concerns several articles (1, 2, 3)
- Some positive support with security and privacy concerns on the Firefox bug
- getDevices() API
- Multiple users have requested the feature on the Crbug
Ergonomics
getDevices() should only need to be used within the Web Bluetooth API.
Activation
Developers would be able to use getDevices() as is.
Debuggability
No extra DevTools support is needed. Chromium has a bluetooth-internals page where developers can debug their Bluetooth devices. This page is accessed via chrome://bluetooth-internals in Chrome and edge://bluetooth-internals in Edge.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?