Skip to content

Tag: service-worker

Relay information to the service worker on install

I have a PWA with multiple different languages and would like to cache only language specific files on install. I can’t find out a way to communicate the language to the service worker during install. Ideas on how I could do it? My js code to initiate the service worker: My code in the service-worker.js…

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 abou…