ContentIndexEvent:id 属性
注意:此功能仅在 Service Workers 中可用。
ContentIndexEvent 接口的只读属性 id 是一个 String,它通过 id 标识被删除的内容索引。
值
被删除的内容索引 ID 的 String 表示。
示例
此示例侦听 contentdelete 事件并记录已移除的内容索引 ID。
ContentIndexEvent 仅在 的 全局作用域 中可用。ServiceWorker
js
self.addEventListener("contentdelete", (event) => {
console.log(event.id);
// logs content index id, which can then be used to determine what content to delete from your cache
});
规范
| 规范 |
|---|
| Content Index # dom-contentindexevent-id |
浏览器兼容性
加载中…