Bluetooth: getDevices() method
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.
ThegetDevices() method of theBluetooth interface returns an array containing the Bluetooth devices that this origin is allowed to access — including those that are out of range and powered off.
In this article
Syntax
getDevices()Parameters
None.
Return value
APromise that resolves with an array ofBluetoothDevice objects.
Exceptions
SecurityErrorDOMExceptionThrown if this operation is not permitted in this context due tosecurity concerns, such as being called when access to the current document is blocked by thePermissions Policy directive
bluetooth.
Specifications
| Specification |
|---|
| Web Bluetooth> # dom-bluetooth-getdevices> |