PressureObserver: thuộc tính tĩnh knownSources

Khả dụng hạn chế

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Note: This feature is available in Web Workers, except for Service Workers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Thuộc tính tĩnh chỉ đọc knownSources của giao diện PressureObserver trả về một mảng các giá trị source được user agent hỗ trợ, theo thứ tự bảng chữ cái.

Note: Danh sách các nguồn được hỗ trợ khác nhau tùy theo trình duyệt, hệ điều hành và phần cứng, và đang thay đổi. Thuộc tính này chỉ là một gợi ý về các loại nguồn mà user agent hỗ trợ. Hãy gọi observe() và kiểm tra NotSupportedError để xem liệu việc quan sát áp lực có khả thi không.

Giá trị

Một mảng các giá trị PressureRecord.source.

Ví dụ

Sử dụng console để xem các nguồn được biết

Để tìm hiểu trình duyệt biết các giá trị source nào, hãy nhập PressureObserver.knownSources vào console. Điều này sẽ trả về một mảng các nguồn đã biết.

js
PressureObserver.knownSources;
// returns ["cpu"] in Chrome 125

Thông số kỹ thuật

Thông số kỹ thuật
Compute Pressure Level 1
# dom-pressureobserver-knownsources

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