Ship weekly scenarios with the weekly puzzle run; docs and skills

This commit is contained in:
Frederic Jung 2026-10-29 17:34:38 +01:00
parent d8df1e37f6
commit 0ece48a79d
No known key found for this signature in database
6 changed files with 42 additions and 20 deletions

View file

@ -25,8 +25,8 @@ self.addEventListener('fetch', (e) => {
}
const local = url.origin === location.origin, fonts = /fonts\.(googleapis|gstatic)\.com$/.test(url.hostname);
if (!local && !fonts) return;
// Weekly puzzles are published between releases: ask the network first, and keep a copy for playing offline.
if (local && url.pathname.startsWith('/puzzles/weekly/')) {
// Weekly puzzles and scenarios are published between releases: ask the network first, and keep a copy for offline.
if (local && (url.pathname.startsWith('/puzzles/weekly/') || url.pathname.startsWith('/scenarios/weekly/'))) {
e.respondWith(fetch(req).then((r) => { if (r.ok) { const copy = r.clone(); caches.open(CACHE).then((c) => c.put(req, copy)); } return r; })
.catch(() => caches.match(req).then((r) => r || Response.error())));
return;