← Back to release summary

Service Worker: ServiceWorkerRegistration.update() returns a promise

Category
Service Worker
Type
New or changed feature
Status
Enabled by default (Chrome 46)
Intent stage
None

Summary

update() pings the server for an updated version of this Service Worker registration. This feature was shipped in milestone 45. In milestone 46, update() returns a promise that resolves with 'undefined' if the operation completed successfully or there was no update, and rejects if update failed. If the new worker ran but installation failed, the promise still resolves (same with register()).

Standards & signals

Docs: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/update

View on chromestatus.com