Search completed in 1.04 seconds.
4 results for "controllerchange":
ServiceWorkerContainer.oncontrollerchange - Web APIs
Web › API › ServiceWorkerContainer › oncontrollerchange
working draft initial definition. ...
... working draft initial definition. ...
... working draft initial definition. ...
...And 2 more matches
Index - Web APIs
Web › API › Index
, 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.oncontrollerchange api, experimental, interface, property, reference, service workers, serviceworker, serviceworkercontainer, onchange the oncontrollerchange 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
Web › API › ServiceWorkerContainer
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.oncontrollerchange 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.oncontrollerchange = 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. ...
Clients.claim() - Web APIs
Web › API › Clients › claim
when a service worker is initially registered, pages won't use it until they next load. the claim() method causes those pages to be controlled immediately. be aware that this results in your service worker controlling pages that loaded regularly over the network, or possibly via a different service worker. syntax await clients.claim(); parameters none. ...