Skip to content

Commit

Permalink
$mol_offline: SOOP/SOEP
Browse files Browse the repository at this point in the history
  • Loading branch information
jin committed Dec 31, 2024
1 parent cc6ff64 commit 581022e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions offline/offline.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit 581022e

Please sign in to comment.