Is it possible to track geolocation with a service worker while PWA is not open

The solution is at hand and has been for some years now as this POC clearly testifies. Unfortunately W3C have fought tooth and nail to prevent it from being made available 🙁 Why? I know not. The “cui bono” argument points to plug-in vendors such as Ionic whose whole raison d’etre appears to be background … Read more

Progressive Web App – Service Worker not serving start_URL

Noted from Register A service worker, If we register the service worker file at /example/sw.js, then the service worker would only see fetch events for pages whose URL starts with /example/ (i.e. /example/page1/, /example/page2/). Inline with the shown error and given in this documentation, check the following: Define a start_url property in your manifest.json file. … Read more

Can a progressive web app (PWA) run a background service on a mobile device to get data from hardware (accelerometer, gps…)?

The modern method of running code “in the background” is by using a service worker, either via its push event handler (triggered via an incoming push message), or via its sync event handler (triggered by an automatic replay of a task that previously failed). It’s not currently possible to access the type of hardware sensors … Read more

How to Remove Chrome Logo from PWA App Home Screen Link (Android O Preview)

Above answer is not accurate except for the part that Chrome had the issue of adding Chrome badge to App icon, which is changed in the following updates. Before getting into whats wrong, here is how web apps are added to home screen. 1) As a simple shortcut(like a bookmark), when the users web browser … Read more

Can I have multiple service workers both intercept the same fetch request?

No, you can not. Only one service worker per scope is allowed to be registered so the latest kick the previous one out unless the scope is more specific, in this case, the request is attended by the most specific only. Nevertheless, you can attach multiple fetch handlers and they all will process the request … Read more

How do I set the start_url of a manifest.json to be the root of the site?

If you are running in the root of a site, for instance https://example.com/manifest.json or https://test.example.com/manifest.json you can use “start_url”: “https://stackoverflow.com/”. However, this will also map https://example.com/test/manifest.json to https://example.com/, which fails because it’s in a folder outside the scope of the manifest. Instead, if you are using a sub-directory you need to set both a scope … Read more