Draft This page is not complete.
The ContentIndexEvent()
constructor creates a new ContentIndexEvent
object whose type and other options are configured as specified.
Syntax
var ContentIndexEvent = new ContentIndexEvent(type, ContentIndexEventInit);
Parameters
- type
- A
DOMString
indicating the event which occurred. ForContentIndexEvent
, this is alwaysdelete
. - eventInitDict Optional
- An options object containing any initialization data you want to populate the
ContentIndexEvent
object with. The options are:
id
- The id of the indexed content you want the
ContentIndexEvent
to remove.
- The id of the indexed content you want the
Return value
A ContentIndexEvent
object configured using the given inputs.
Examples
This examples constructs a new ContentIndexEvent
with the relevant id.
var removeData = {
id : 'unique-content-id'
}
var ciEvent = new ContentIndexEvent('contentdelete', removeData);
ciEvent.id; // should return 'unique-content-id'
Specifications
Specification | Status | Comment |
Content Index APIThe definition of 'ContentIndexEvent' in that specification. | Editor's Draft | Initial definition. |
Browser compatibility
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.ContentIndexEvent" (depth: 1) to the MDN compatibility data repository.
See also:
- An introductory article on the Content Index API
- An app which uses the Content Index API to list and remove 'save for later' content
- Service Worker API, along with information about Cache and CacheStorage
ContentIndexEvent() by Mozilla Contributors is licensed under CC-BY-SA 2.5.