I’ve noticed that my service worker doesn’t respond to self.skipWaiting() when there are still tasks to be run. In my service worker’s fetch event, I see various Firebase polls that use HTTP POST requests. If I handle these requests in the service worker like so: Then self.skipWaiting() always works as expected. However, if I do the following: Then self.skipWaiting() seems
Tag: service-worker
How to access cache web storage in service worker in the client?
I’m figuring out how to access data stored in service worker web cache. My service worker looks like this: Where the three las ones URLS inside the event ‘install’ are request to my server which responds with JSON that I need to access in the client. They’re stored correctly in the cache. Then, how can I have access to this
javascript how to modify the current response in service worker?
I use service worker to modify the fetch response with below code, Whichi will lead to this warning and error, The FetchEvent for “” resulted in a network error response: the promise was rejected. sw.js:60 Uncaught (in promise) TypeError: Failed to execute ‘clone’ on ‘Response’: Response body is already used at sw.js:60 If I put the clone() before arrayBuffer() like
Should I return a promise in a JS Service Worker onFetch callback function if I don’t want to do anything with the original request?
My scenario is the following: I have a Progressive Web App that uses a Service Worker where I need to catch the request and do something with it every time the user requests a resource or leaves the current URL I’m handling that through adding a callback to the fetch event of the worker I only care about requested resources
SPA content refresh with constant updating
I know that recommended approach to updating SPA versions is to use service workers and alert user that he should refresh page. But what options do we have when there’s lots of pages and new things …
Not getting service worker with create-react-app
lately, I have create two react application and in both of them the service worker is not present instead a new file is generated i.e ‘reportWebVitals.js’. Here is my folder structure of src after …
Service worker – update cache on new version using skipWaiting()
I have implemented Workbox to generate my service worker using webpack. This works – I can confirm revision is updated in the generated service worker when running “generate-sw”: “workbox inject:manifest”. The problem is – I have noticed my clients are not updating the cache after a new release. Even days after updating the service worker my clients are still caching
Service Workers – selectively choose resources
I have a simple Service Worker implementation like this: My goal is to cache all resources except the two files indicated in the urlsToCache variable, these two files should ALWAYS be requested from the network.. How can i achieve this? How can I then verify that it is actually so? Answer You can check the […]
Overriding Angular’s Service Worker to handle POST requests
I have an angular/nodejs application in which a User can see a list of resources, update them, create them, and delete them (a basic CRUD application). I want to turn this into a PWA so the user can …
Can’t find serviceWorker in navigator anymore
since the new update of Google Chrome (version 69.0.3497.92 (official build) (64-bit)) I can’t find the serviceWorker service in the Navigator anymore. Actually I could register my Service Worker as …