Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR gives the Navidrome web UI a 'proper' own service worker, not just the current boilerplate
service-worker.jsthat gets auto-generated during the build process by CRA, which is outdated anyway since it loads Workbox v3 libraries instead of the current v6.1.2. Plus, that service worker caches stuff for offline usage, which breaks things.Workbox, by the way, is pretty cool stuff: basically it's a set of Google libraries to make service workers easy. See: https://developers.google.com/web/tools/workbox
Changes in this PR:
navidrome-service-worker.jsso it doesn't get overwritten by the CRA generated oneoffline.htmlcontaining an error messageSo what does the service worker do?
offline.htmlon installoffline.htmlwhen the server is unreachable (=fixes service worker: "fetch" event handler needs to return a valid response when the device is offline #911 )Please test this, for example:
offline.htmlgets displayed