Add PWA support (I think)
This commit is contained in:
12
static/manifest.json
Normal file
12
static/manifest.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "ReSendit",
|
||||
"short_name": "ReSendit",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#ffffff",
|
||||
"theme_color": "#000000",
|
||||
"icons": [
|
||||
{ "src": "/logo.png", "sizes": "192x192", "type": "image/png" },
|
||||
{ "src": "/logo.png", "sizes": "512x512", "type": "image/png" }
|
||||
]
|
||||
}
|
||||
13
static/sw.js
Normal file
13
static/sw.js
Normal file
@@ -0,0 +1,13 @@
|
||||
self.addEventListener('install', e => {
|
||||
e.waitUntil(
|
||||
caches.open('resendit-v1').then(cache => {
|
||||
return cache.addAll(['/', '/index.html', '/login.html', '/logo.png']);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', e => {
|
||||
e.respondWith(
|
||||
caches.match(e.request).then(response => response || fetch(e.request))
|
||||
);
|
||||
});
|
||||
@@ -6,6 +6,12 @@
|
||||
<title>Send.it</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('/sw.js');
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
* {
|
||||
border-radius: 0 !important;
|
||||
|
||||
Reference in New Issue
Block a user