Intent to Prototype: Web Bluetooth BluetoothDevice.watchAdvertisements()

92 views
Skip to first unread message

Ovidio Ruiz-Henríquez

unread,
Apr 29, 2020, 7:13:32 PM4/29/20
to blink-dev
odej...@chromium.org Specification: https://webbluetoothcg.github.io/web-bluetooth/ https://docs.google.com/document/d/1h3uAVXJARHrNWaNACUPiQhLt7XI-fFFQoARSs1WgMDM/edit#heading=h.jdnga4sjs82y Web Bluetooth API: https://github.com/w3ctag/design-reviews/issues/139 Web Bluetooth Scanning API: https://github.com/w3ctag/design-reviews/issues/333 The Web Bluetooth API TAG review discusses how Web Bluetooth mitigates privacy risks through a user prompt. watchAdvertisements() can only be used on a BluetoothDevice object, which is only available after being granted device access through the prompt. The Bluetooth Scanning API mentions a privacy issue around knowing the devices around the user. watchAdvertisements() only notifies the web app if an advertisement is received for the BluetoothDevice that it was called on. The BluetoothDevice.watchAdvertisements() API will enable web apps to receive events when the system receives an advertisement packet from the device for which advertisements are being watched for. This API will allow web apps to detect whether a device is unresponsive because it has gone out of range by listening for advertisement packets from the device. Without this API, operations on the Bluetooth device would hang until the device was timed out on the system, causing a 'gattserverdisconnected' event to be fired. With persistent permissions for Web Bluetooth, watchAdvertisements() will enable web apps to check if a permitted device is in range of the system before attempting to connect to the device.
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 public signals (https://github.com/mozilla/standards-positions/issues/95) There were concerns shared with WebUSB and WebMIDI, but ultimately the discussion ended without a distinct signal on the API. Edge: Shipped (https://developer.microsoft.com/en-us/microsoft-edge/status/webbluetooth/) Safari: No public signals (https://webkit.org/status/#feature-web-bluetooth) https://bugs.webkit.org/show_bug.cgi?id=101034 Web developers: No signals No signal on BluetoothDevice.watchAdvertisements() API in particular, but it will be very useful with the getDevices() API. watchAdvertisements() should only be used within the Web Bluetooth API. Developers would be able to use watchAdvertisements() as is. https://docs.google.com/document/d/1h3uAVXJARHrNWaNACUPiQhLt7XI-fFFQoARSs1WgMDM/edit#heading=h.k389oryrnj5o
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. No https://github.com/WebBluetoothCG/web-bluetooth/blob/master/implementation-status.md#implementation-status No Web platform tests will be added as this feature is implemented. The tests will use the Web Bluetooth testing API and will be added to the wpt/bluetooth directory. https://github.com/web-platform-tests/wpt/tree/master/bluetooth https://chromestatus.com/feature/5180688812736512
This intent message was generated by Chrome Platform Status.

Ovidio Ruiz-Henríquez

unread,
Apr 29, 2020, 8:39:48 PM4/29/20
to blink-dev
A small clarification, Edge hasn't shipped watchAdvertisements(). They have the same subset of Web Bluetooth APIs that Chrome currently has.
Reply all
Reply to author
Forward
0 new messages