lavas-project / jekyll-pwa

Jekyll plugin for PWA
MIT License
107 stars 19 forks source link

How to listen for sw.update? #35

Closed rdy4ever closed 3 years ago

rdy4ever commented 3 years ago

Hi. I'm using your plugin for a Jekyll project. Everything works OK, but I'm not able to listen for the sw.update event. I tried to test the event like this:

window.addEventListener("sw.update", function() {
    console.log("Site has updated");
});

... but no message is generated in the console when I regenerate the site and the service worker changes.

Thanks

rdy4ever commented 3 years ago

PR: https://github.com/lavas-project/jekyll-pwa/pull/36/files