diff --git a/offline/offline.web.ts b/offline/offline.web.ts index 2b1d160cc4..505da74bba 100644 --- a/offline/offline.web.ts +++ b/offline/offline.web.ts @@ -49,6 +49,17 @@ namespace $ { const fetch_data = () => fetch( request ).then( response => { if (response.status !== 200) return response + + const headers = new Headers( response.headers ) + headers.set( "Cross-Origin-Embedder-Policy", "credentialless" ) + headers.set( "Cross-Origin-Opener-Policy", "same-origin" ) + + response = new Response( response.body, { + status: response.status, + statusText: response.statusText, + headers, + }); + event.waitUntil( caches.open( '$mol_offline' ).then( cache => cache.put( request , response )