Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkiro authored Nov 8, 2024
1 parent 215f4e0 commit 5aab52d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions public/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// This is the "Offline copy of pages" service worker

const CACHE = "pwabuilder-offline";

importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js');

Check failure on line 5 in public/sw.js

View workflow job for this annotation

GitHub Actions / check-code-style

'importScripts' is not defined

Check failure on line 5 in public/sw.js

View workflow job for this annotation

GitHub Actions / check-code-style

Replace `'https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js'` with `"https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js"`

self.addEventListener("message", (event) => {
if (event.data && event.data.type === "SKIP_WAITING") {
self.skipWaiting();
}
});

workbox.routing.registerRoute(

Check failure on line 13 in public/sw.js

View workflow job for this annotation

GitHub Actions / check-code-style

'workbox' is not defined
new RegExp('/*'),

Check failure on line 14 in public/sw.js

View workflow job for this annotation

GitHub Actions / check-code-style

Use a regular expression literal instead of the 'RegExp' constructor

Check failure on line 14 in public/sw.js

View workflow job for this annotation

GitHub Actions / check-code-style

Use the 'u' flag

Check failure on line 14 in public/sw.js

View workflow job for this annotation

GitHub Actions / check-code-style

Replace `'/*'` with `"/*"`
new workbox.strategies.StaleWhileRevalidate({

Check failure on line 15 in public/sw.js

View workflow job for this annotation

GitHub Actions / check-code-style

'workbox' is not defined
cacheName: CACHE

Check failure on line 16 in public/sw.js

View workflow job for this annotation

GitHub Actions / check-code-style

Insert `,`
})

Check failure on line 17 in public/sw.js

View workflow job for this annotation

GitHub Actions / check-code-style

Insert `,`
);

Check failure on line 18 in public/sw.js

View workflow job for this annotation

GitHub Actions / check-code-style

Insert `⏎`

0 comments on commit 5aab52d

Please sign in to comment.