Search completed in 1.52 seconds.
7 results for "contentdelete":
ServiceWorkerGlobalScope: contentdelete event - Web APIs
WebAPIServiceWorkerGlobalScopecontentdelete event
the contentdelete event of the serviceworkerglobalscope interface is fired when an item is removed from the indexed content via the user agent.
... bubbles no cancelable no interface contentindexevent event handler property oncontentdelete examples the following example uses a contentdelete event handler to remove cached content related to the deleted index item.
... self.addeventlistener('contentdelete', event => { event.waituntil( caches.open('cache-name').then(cache => { return promise.all([ cache.delete(`/icon/${event.id}`), cache.delete(`/content/${event.id}`) ]) }) ); }); you can also set up the event handler using the serviceworkerglobalscope.ondelete property: self.oncontentdelete = (event) => { ...
... }; specifications specification status comment unknownthe definition of 'contentdelete' in that specification.
ServiceWorkerGlobalScope.oncontentdelete - Web APIs
WebAPIServiceWorkerGlobalScopeoncontentdelete
the oncontentdelete property of the serviceworkerglobalscope interface is an event handler fired when an item is removed from the indexed content via the user agent.
... syntax serviceworkerglobalscope.oncontentdelete = function(event) { ...
... }; examples the following example uses a contentdelete event handler to remove cached content related to the deleted index item.
... self.addeventlistener('contentdelete', event => { event.waituntil( caches.open('cache-name').then(cache => { return promise.all([ cache.delete(`/icon/${event.id}`), cache.delete(`/content/${event.id}`) ]) }) ); }); specifications specification status comment unknownthe definition of 'contentdelete' in that specification.
ContentIndexEvent - Web APIs
WebAPIContentIndexEvent
the contentindexevent interface of the content index api defines the object used to represent the contentdelete event.
... the contentdelete event is only fired when the deletion happens due to interaction with the browser's built-in user interface.
... examples this example shows the sevice worker script listening for the contentdelete event and logs the removed content index id.
... 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 }); specifications specification status comment unknownthe definition of 'contentindexevent' in that specification.
Content Index API - Web APIs
WebAPIContent Index API
contentindexevent the contentindexevent interface of the content index api defines the object used to represent the contentdelete event.
... serviceworkerglobalscope.oncontentdelete an event handler fired whenever a contentdelete event occurs.
...they are accessible from the workerglobalscope.self property: // service worker script self.registration.index.add(item); self.registration.index.delete(item.id); const contentindexitems = self.registration.index.getall(); contentdelete event when an item is removed from the user agent interface, a contentdelete event is received by the service worker.
... 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 contentdelete event is only fired when the deletion happens due to interaction with the browser's built-in user interface.
ContentIndexEvent.id - Web APIs
WebAPIContentIndexEventid
examples this example listens for the contentdelete event and logs the removed content index id.
... 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 }); specifications specification status comment unknownthe definition of 'id' in that specification.
ServiceWorkerGlobalScope - Web APIs
WebAPIServiceWorkerGlobalScope
contentdelete occurs when an item is removed from the content index.
... also available via the serviceworkerglobalscope.oncontentdelete property.
ContentIndexEvent() - Web APIs
WebAPIContentIndexEventContentIndexEvent
var removedata = { id : 'unique-content-id' } var cievent = new contentindexevent('contentdelete', removedata); cievent.id; // should return 'unique-content-id' specifications specification status comment unknownthe definition of 'contentindexevent' in that specification.