Bluetooth
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Giao diện Bluetooth của Web Bluetooth API cung cấp các phương thức để truy vấn khả năng Bluetooth và yêu cầu quyền truy cập vào thiết bị.
Thuộc tính thể hiện
Kế thừa các thuộc tính từ giao diện cha là EventTarget.
Phương thức thể hiện
Bluetooth.getAvailability()Experimental-
Trả về một
Promisegiải quyết thành giá trị boolean cho biết user agent có thể hỗ trợ Bluetooth hay không. Một số user agent cho phép người dùng cấu hình một tùy chọn quy định giá trị mà phương thức này trả về. Bluetooth.getDevices()Experimental-
Trả về một
Promisegiải quyết thành một mảngBluetoothDevicemà origin này được phép truy cập. Quyền này có được từ các lần gọi trước tớiBluetooth.requestDevice(). Bluetooth.requestDevice()Experimental-
Trả về một
Promisegiải quyết thành một đối tượngBluetoothDevicekhớp với các tùy chọn được chỉ định.
Thông số kỹ thuật
| Specification |
|---|
| Web Bluetooth> # bluetooth> |