Skip to content

Commit

Permalink
Add mincoi
Browse files Browse the repository at this point in the history
  • Loading branch information
laffra authored Oct 10, 2024
1 parent eed84c8 commit b8ad8e7
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,37 @@
<link rel="icon" type="image/x-icon" href="favicon.ico">
<meta name="viewport" content="width=device-width,initial-scale=1">

<script>
/*! coi-serviceworker v0.1.7 - Guido Zuidhof and contributors, licensed under MIT */
/*! mini-coi - Andrea Giammarchi and contributors, licensed under MIT */
(({ document: d, navigator: { serviceWorker: s } }) => {
if (d) {
const { currentScript: c } = d;
s.register(c.src, { scope: c.getAttribute('scope') || '.' }).then(r => {
r.addEventListener('updatefound', () => location.reload());
if (r.active && !s.controller) location.reload();
});
}
else {
addEventListener('install', () => skipWaiting());
addEventListener('activate', e => e.waitUntil(clients.claim()));
addEventListener('fetch', e => {
const { request: r } = e;
if (r.cache === 'only-if-cached' && r.mode !== 'same-origin') return;
e.respondWith(fetch(r).then(r => {
const { body, status, statusText } = r;
if (!status || status > 399) return r;
const h = new Headers(r.headers);
h.set('Cross-Origin-Opener-Policy', 'same-origin');
h.set('Cross-Origin-Embedder-Policy', 'require-corp');
h.set('Cross-Origin-Resource-Policy', 'cross-origin');
return new Response(body, { status, statusText, headers: h });
}));
});
}
})(self);
</script>

<!-- Import PyScript - see kitchensink.js for activation -->
<script type="module" src="https://pyscript.net/releases/2023.11.1/core.js"></script>
<link rel="stylesheet" href="https://pyscript.net/releases/2023.11.1/core.css" />
Expand Down Expand Up @@ -36,4 +67,4 @@ <h1 id="title">The <a href=https://github.com/laffra/ltk>LTK</a> Kitchensink for
<script src="kitchensink.js"></script>
</body>

</html>
</html>

0 comments on commit b8ad8e7

Please sign in to comment.