BackgroundFetchEvent: thuộc tính registration
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 only available in Service Workers.
Thuộc tính chỉ đọc registration của giao diện BackgroundFetchEvent trả về một đối tượng BackgroundFetchRegistration.
Giá trị
Ví dụ
Trong ví dụ này, nếu người dùng nhấp vào giao diện người dùng đang hiển thị tiến trình tải xuống, điều này sẽ kích hoạt sự kiện backgroundfetchclick. BackgroundFetchRegistration hiện tại được trả về bằng cách gọi event.registration.
js
addEventListener("backgroundfetchclick", (event) => {
console.log(event.registration);
});
Thông số kỹ thuật
| Thông số kỹ thuật |
|---|
| Background Fetch> # dom-backgroundfetchevent-registration> |