ContentIndexEvent: thuộc tính id
Limited availability
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 id của giao diện ContentIndexEvent là một String xác định mục nội dung đã bị xóa thông qua id của nó.
Giá trị
Biểu diễn String của id mục nội dung đã bị xóa.
Ví dụ
Ví dụ này lắng nghe sự kiện contentdelete và ghi nhật ký id của mục nội dung bị xóa.
ContentIndexEvent chỉ khả dụng trong phạm vi toàn cục của một ServiceWorker.
js
self.addEventListener("contentdelete", (event) => {
console.log(event.id);
// ghi nhật ký id của mục nội dung, sau đó có thể dùng để xác định nội dung nào cần xóa khỏi bộ nhớ đệm
});
Thông số kỹ thuật
| Specification |
|---|
| Content Index> # dom-contentindexevent-id> |