Skip to content

Commit

Permalink
Deploying to gh-pages from @ 1c9eacd 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
nin-jin committed Jan 4, 2025
1 parent ef55494 commit bd5eda8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion web.deps.json

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions web.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web.js.map

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions web.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10620,24 +10620,26 @@ var $;
return;
if (request.cache === 'no-store')
return;
const fetch_data = () => fetch(request).then(response => {
const fetch_data = () => fetch(new Request(request, { credentials: 'omit' })).then(response => {
if (response.status !== 200)
return response;
event.waitUntil(caches.open('$mol_offline').then(cache => cache.put(request, response)));
return response.clone();
});
const enrich = (response) => {
if (!response.status)
return response;
const headers = new Headers(response.headers);
headers.set("Cross-Origin-Embedder-Policy", "require-corp");
headers.set("Cross-Origin-Opener-Policy", "same-origin");
headers.set("$mol_offline", "");
response = new Response(response.body, {
return new Response(response.body, {
status: response.status,
statusText: response.statusText,
headers,
});
event.waitUntil(caches.open('$mol_offline').then(cache => cache.put(request, response)));
return response.clone();
});
};
const fresh = request.cache === 'force-cache' ? null : fetch_data();
if (fresh)
event.waitUntil(fresh);
event.waitUntil(fresh.then(enrich));
event.respondWith(caches.match(request).then(cached => request.cache === 'no-cache' || request.cache === 'reload'
? (cached
? fresh
Expand All @@ -10653,7 +10655,7 @@ var $;
return cloned;
})
: fresh)
: (cached || fresh || fetch_data())));
: (cached || fresh || fetch_data())).then(enrich));
});
self.addEventListener('beforeinstallprompt', (event) => event.prompt());
}
Expand Down

0 comments on commit bd5eda8

Please sign in to comment.