3 ms·
MDN's web docs were instrumental. They have a nice guide[1]. Beyond that, their docs for the web APIs are great too. It was actually pretty easy, but I did get
by jameal 4y ago
MDN's web docs were instrumental. They have a nice guide[1]. Beyond that, their docs for the web APIs are great too.
It was actually pretty easy, but I did get tripped up by the scope of the service worker. Initially I had the service worker js file in the `scripts` folder but it wouldn't work properly because the scope is by default relative to that file's location. I moved it to the root and that fixed my problem but you can also configure the scope when you register it[2].
[1]: https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps https://developer.mozilla.org/en-US/docs/Web/Progressive_web...
[2]: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register https://developer.mozilla.org/en-US/docs/Web/API/ServiceWork...