I'm currently working on a single page web application with offline mode. Due to the specifics of service workers, a new version of the services worker gets only activated when all tabs of the page are closed.
Several methods and ways exist to serve the new version to the user. I would implement the way where a notification will be shown to him that the page could be reloaded and the new version served. Another way would be to force the reload, but for our use case this is a bad user experience.
But to implement this, I need the registration as argument for the "cached" and "updated" events. Would it be possible to pass the registration as argument?
I'm currently working on a single page web application with offline mode. Due to the specifics of service workers, a new version of the services worker gets only activated when all tabs of the page are closed.
Several methods and ways exist to serve the new version to the user. I would implement the way where a notification will be shown to him that the page could be reloaded and the new version served. Another way would be to force the reload, but for our use case this is a bad user experience.
One way to implement the way with showing a notification is described on this page: https://developers.google.com/web/tools/workbox/guides/advanced-recipes#offer_a_page_reload_for_users
But to implement this, I need the registration as argument for the "cached" and "updated" events. Would it be possible to pass the registration as argument?