Search completed in 1.04 seconds.
Index - Web APIs
, workers the clients interface provides access to client objects. access it via self.clients within a service worker. 631 clients.claim() api, clients, experimental, method, reference, service workers, serviceworker, claim the claim() method of the clients allows an active service worker to set itself as the controller for all clients within its scope. this triggers a "
controllerchange" event on navigator.serviceworker in any clients that become controlled by this service worker. 632 clients.get() api, clients, experimental, method, reference, service workers, get the get() method of the clients interface gets a service worker client matching a given id and returns it in a promise. 633 clients.matchall() api, clients, experimental, method, re...
...registrations() api, experimental, method, reference, service workers, serviceworker, serviceworkercontainer the getregistrations() method of the serviceworkercontainer interface returns all serviceworkerregistrations associated with a serviceworkercontainer in an array. if the method can't return serviceworkerregistrations, it returns a promise. 3945 serviceworkercontainer.on
controllerchange api, experimental, interface, property, reference, service workers, serviceworker, serviceworkercontainer, onchange the on
controllerchange property of the serviceworkercontainer interface is an event handler fired whenever a
controllerchange event occurs — when the document's associated serviceworkerregistration acquires a new serviceworkerregistration.active worker. 3946 s...
ServiceWorkerContainer - Web APIs
serviceworkercontainer.ready read only provides a way of delaying code execution until a service worker is active. it returns a promise that will never reject, and which waits indefinitely until the serviceworkerregistration associated with the current page has an serviceworkerregistration.active worker. once that condition is met, it resolves with the serviceworkerregistration. events
controllerchange occurs when the document's associated serviceworkerregistration acquires a new active worker. also available via the serviceworkercontainer.on
controllerchange property. error fired whenever an error occurs in the associated service workers. also available via the serviceworkercontainer.onerror property. message occurs when incoming messages are received by the serviceworkercontainer object...
...rker, and when that // controller changes. // first, do a one-off check if there's currently a // service worker in control. if (navigator.serviceworker.controller) { console.log('this page is currently controlled by:', navigator.serviceworker.controller); } // then, register a handler to detect when a new or // updated service worker takes control. navigator.serviceworker.on
controllerchange = function() { console.log('this page is now controlled by:', navigator.serviceworker.controller); }; } else { console.log('service workers are not supported.'); } specifications specification status comment service workersthe definition of 'serviceworkercontainer' in that specification. working draft initial definition. ...