Make required changes to allow Progressive Web App functionality #2
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.
After seeing you have made some changes to the code, I had another look at what I was trying to do with the copy on my server.
This is not so much a pull request as it is an FYI submission. I don't expect all changes to be accepted / merged.
The PWA functionality means the code can be installed to run like an "app" on a mobile device (and even some desktops).
As part of the changes, I also took the chance to clean up some of the file naming syntax. e.g. the JS files are now named to match the relative PHP file that references them. I also created a simple favicon using this flat icon. By removing the reference to the favicon on your non-HTTPS URL, it removes the security-related issues that result from mixing secure and insecure URL.
Technically, it is possible to amend the serviceworker.js file to include the urls of each recipe (and any images). From there, a change of version number in the manifest.json file would cause the 'app' on the phone to sync any new recipes and cache them locally. In the current setup, no caching of recipes is done.
BTW, you have two recipe templates, with a slight difference between the two.
Note: the URL in my serviceworker.js include the subdirectory that is in the URL for my copy of the code. It would need to be removed at your end.