yyx990803 / register-service-worker

A script to simplify service worker registration with hooks for common events.
MIT License
638 stars 58 forks source link

Add registered event #3

Closed alexlanz closed 6 years ago

alexlanz commented 6 years ago

In some use cases it would be nice to know when the service worker was registered. Especially, if the two other events (cached, updated) are not fired. This happens when the browser already has the newest assets stored in the cache.

In this case there is no possibility with this library to access the registration. With the new event, the registration gets passed immediately after the registration.