Changeset a3e0746 in Klonkt
- Timestamp:
- 06/27/2026 09:02:29 AM (2 months ago)
- Branches:
- main
- Children:
- ca0ad44
- Parents:
- cb95343
- File:
-
- 1 edited
-
src/server.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/server.js
rcb95343 ra3e0746 395 395 res.set('Cache-Control', 'no-cache'); 396 396 res.send(` 397 const CACHE_VERSION = 'pcms-v1 5-' + new Date().toISOString().split('T')[0];397 const CACHE_VERSION = 'pcms-v16-' + new Date().toISOString().split('T')[0]; 398 398 self.addEventListener('install', e => { 399 399 e.waitUntil(caches.open(CACHE_VERSION).then(c => c.addAll(['/']))); … … 414 414 if (e.request.method !== 'GET') return; 415 415 if (e.request.mode !== 'navigate') return; // page loads only 416 // Same-origin ONLY. A cross-origin navigate request is an <iframe> embed 417 // (YouTube/Spotify/SoundCloud …) — routing those through the SW yields an 418 // opaque/altered response the iframe cannot render → blank embeds in the 419 // installed PWA (which is always SW-controlled). Let the browser load them. 420 try { if (new URL(e.request.url).origin !== self.location.origin) return; } catch (err) { return; } 416 421 e.respondWith( 417 422 fetch(e.request).catch(() => caches.match('/').then(r => r || Response.error()))
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)