Forget already paired device - web-bluetooth

Viewed 293
1 Answers

What a coincidence! I am currently working on adding a new forget() method on BluetoothDevice so that web developers can revoke permission access to a paired BluetoothDevice.

// Request a Bluetooth device.
const device = await navigator.bluetooth.requestDevice({ acceptAllDevices: true });

// Then later... revoke permission to the Bluetooth device.
await device.forget();

Note that this experimental functionality is currently available in Chrome 101 and requires users to enable the chrome://flags/#enable-web-bluetooth-new-permissions-backend flag.

You can try my sample at https://bluetoothdevice-forget.glitch.me/

Related