草案
此页面不完整。

只读 id 特性为 ContentIndexEvent 接口是 字符串 which identifies the deleted content index via it's id .

句法

var id = ContentIndexEvent.id;
					

A 字符串 representation of the deleted content index id.

范例

This example listens for the contentdelete event and logs the removed content index id.

ContentIndexEvent is only available to the {domxref('ServiceWorkerGlobalScope','global scope')}} of a ServiceWorker .

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
});
					

规范

规范 状态 注释
未知
The definition of 'id' in that specification.
未知 初始定义。

浏览器兼容性

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.

No compatibility data found. Please contribute data for "api.ContentIndexEvent.id" (depth: 1) to the MDN 兼容性数据存储库 .

另请参阅:

元数据

  • 最后修改: