Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forget already paired device - web-bluetooth

I am working on web-bluetooth to connect a Web-App with BLE device. I have the connections now, I am looking how can I unpair a device.

I have looked into the official web-bluetooth documents https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-getdevices haven't find much about it.

Can anybody suggest something on this?

Thanks

like image 764
UGandhi Avatar asked Dec 12 '25 23:12

UGandhi


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();
  • Spec PR: https://github.com/WebBluetoothCG/web-bluetooth/pull/574
  • Chromium CL: https://bugs.chromium.org/p/chromium/issues/detail?id=1302328

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/

like image 84
François Beaufort Avatar answered Dec 14 '25 12:12

François Beaufort