Bluetooth:getDevices() 方法
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Bluetooth 接口的 getDevices() 方法返回包含此来源被允许访问的蓝牙设备(包括那些超出范围和已关闭电源的设备)的数组。
语法
js
getDevices()
参数
无。
返回值
一个 Promise,其会兑现为一个 BluetoothDevice 对象数组。
异常
SecurityErrorDOMException
规范
| Specification |
|---|
| Web Bluetooth> # dom-bluetooth-getdevices> |
浏览器兼容性
Loading…