feat: multi-language subtitle support (SRT/VTT)

This commit is contained in:
Nice Try
2026-06-26 20:12:48 +00:00
parent 33e5e61b11
commit 7d0f976da0
6 changed files with 98 additions and 6 deletions
+19 -3
View File
@@ -1,7 +1,7 @@
// OfflineAcademy Service Worker v3Minimal, Chrome-install-criteria focused
// OfflineAcademy Service Worker v4Offline support without stale Next.js dev chunks
// Logs to console so you can verify it's controlling the page
const CACHE = "oa-v5"
const CACHE = "oa-v6"
const ASSETS = [
'/',
'/site.webmanifest',
@@ -29,6 +29,22 @@ self.addEventListener('fetch', e => {
const url = new URL(e.request.url)
console.log('[SW] Fetch:', url.pathname)
// Never cache Next.js runtime/dev chunks or HMR/RSC payloads. Stale chunks can keep old runtime errors alive.
if (
url.pathname.startsWith('/_next/') ||
url.pathname === '/__nextjs_original-stack-frame' ||
url.pathname === '/__nextjs_launch-editor'
) {
e.respondWith(fetch(e.request))
return
}
// Keep analytics fully live while debugging/runtime data is dynamic.
if (url.pathname === '/analytics') {
e.respondWith(fetch(e.request))
return
}
// Navigation (main page) — network first, cache fallback
if (e.request.mode === 'navigate') {
e.respondWith(networkFirst(e.request))
@@ -86,4 +102,4 @@ self.addEventListener('message', e => {
}
})
console.log('[SW] Loaded - version 3')
console.log('[SW] Loaded - version 4')