start playing with 0.15 bundle format
This commit is contained in:
parent
3be22c5654
commit
ba51d75528
14 changed files with 1221 additions and 288 deletions
BIN
test_template/assets/big-platypus.png
Normal file
BIN
test_template/assets/big-platypus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 934 KiB |
BIN
test_template/assets/isn_s_cube-0.1.0-py3-none-any.whl
Normal file
BIN
test_template/assets/isn_s_cube-0.1.0-py3-none-any.whl
Normal file
Binary file not shown.
32
test_template/assets/mini-coi.js
Normal file
32
test_template/assets/mini-coi.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/*! coi-serviceworker v0.1.7 - Guido Zuidhof and contributors, licensed under MIT */
|
||||
/*! mini-coi - Andrea Giammarchi and contributors, licensed under MIT */
|
||||
/** FEATURE DETECTION VERSION - COMPATIBLE WITH SERVERS THAT DO NOT SUPPORT COI */
|
||||
(({ document: d, navigator: { serviceWorker: s } }) => {
|
||||
if (d) {
|
||||
try { new SharedArrayBuffer(4, { maxByteLength: 8 }) }
|
||||
catch (_) {
|
||||
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(status == 204 ? null : body, { status, statusText, headers: h });
|
||||
}));
|
||||
});
|
||||
}
|
||||
})(self);
|
||||
BIN
test_template/assets/platypus.png
Normal file
BIN
test_template/assets/platypus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 344 KiB |
BIN
test_template/assets/smol-platypus.png
Normal file
BIN
test_template/assets/smol-platypus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Loading…
Add table
Add a link
Reference in a new issue