After testing the web app with Lighthouse I have such error:
User will not be prompted to Install the Web App Browsers can proactively prompt users to add your app to their homescreen, which can lead to higher engagement. Learn more.
Failures: Service worker does not successfully serve the manifest's start_url.
All the criteria described here are satisfied:
The manifest files is rendered via script. Important variables are
scope_url = 'https://website.com/app/'
start_url = 'https://website.com/app/about/'
ServiceWoker.js is quite simple:
self.addEventListener('push', function(e) {
...
});
self.addEventListener('notificationclick', function (e) {
...
);
Web App and sw.js are served from start_url.
What else can I check?
Edit 1. When I try to "Add to homescreen" from Chrome console I get:
Site cannot be installed: the page does not work offline
what is close to this comment
After changing start_url to 'https://website.com/app/' and adding:
self.addEventListener('fetch', function(e){
});
to serviceWorker.js the problem has been solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With