MDN self-hosted library · e01.org

Bluetooth: getDevices() method

Bluetooth API

no runnable cells web-api-instance-method upstream source

Bluetooth API

The getDevices() method of the Bluetooth 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.

Syntax

getDevices()

Parameters

None.

Return value

A Promise that resolves with an array of BluetoothDevice objects.

Exceptions

  • SecurityError DOMException
  • : Thrown if this operation is not permitted in this context due to security concerns, such as being called when access to the current document is blocked by the Permissions Policy directive bluetooth.

Specifications

Browser compatibility