Download spectrum/public/service-worker.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 878 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/public/service-worker.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/public/service-worker.js
-
curl -L -o service-worker.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/public/service-worker.js
878 Bytes
| /* eslint-disable */ | |
| // A simple, no-op service worker that takes immediate control. | |
| // from: https://stackoverflow.com/a/38980776 | |
| self.addEventListener('install', () => { | |
| // Skip over the "waiting" lifecycle state, to ensure that our | |
| // new service worker is activated immediately, even if there's | |
| // another tab open controlled by our older service worker code. | |
| self.skipWaiting(); | |
| }); | |
| self.addEventListener('activate', () => { | |
| // Get a list of all the current open windows/tabs under | |
| // our service worker's control, and force them to reload. | |
| // This can "unbreak" any open windows/tabs as soon as the new | |
| // service worker activates, rather than users having to manually reload. | |
| self.clients.matchAll({ type: 'window' }).then(windowClients => { | |
| windowClients.forEach(windowClient => { | |
| windowClient.navigate(windowClient.url); | |
| }); | |
| }); | |
| }); | |