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ị.

EventTarget Bluetooth

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 Promise giả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 Promise giải quyết thành một mảng BluetoothDevice mà 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ới Bluetooth.requestDevice().

Bluetooth.requestDevice() Experimental

Trả về một Promise giải quyết thành một đối tượng BluetoothDevice khớp với các tùy chọn được chỉ định.

Thông số kỹ thuật

Specification
Web Bluetooth
# bluetooth

Tương thích trình duyệt