diff options
| -rw-r--r-- | src/app.html | 15 | ||||
| -rw-r--r-- | static/manifest.json | 17 | ||||
| -rw-r--r-- | static/manifest.webmanifest | 2 | ||||
| -rw-r--r-- | static/service-worker.js | 7 |
4 files changed, 23 insertions, 18 deletions
diff --git a/src/app.html b/src/app.html index 42e791f7..b3325f4c 100644 --- a/src/app.html +++ b/src/app.html @@ -6,9 +6,24 @@ <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="description" content="An easy bitcoin web wallet" /> <meta name="keywords" content="open source bitcoin lightning web wallet" /> + <link rel="manifest" href="manifest.webmanifest" /> %sveltekit.head% </head> <body> <div>%sveltekit.body%</div> </body> + <script> + if ('serviceWorker' in navigator) { + navigator.serviceWorker.register('/service-worker.js').then( + function (registration) { + console.log('Service worker registration succeeded:', registration); + }, + function (error) { + console.log('Service worker registration failed:', error); + } + ); + } else { + console.log('Service workers are not supported.'); + } + </script> </html> diff --git a/static/manifest.json b/static/manifest.json deleted file mode 100644 index 3ce34fb8..00000000 --- a/static/manifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "short_name": "coinos", - "name": "coinos", - "icons": [ - { - "src": "/icons/coinos.png", - "type": "image/webp", - "sizes": "1024x1024", - "purpose": "any maskable" - } - ], - "start_url": "/", - "background_color": "#000000", - "display": "standalone", - "scope": "/", - "theme_color": "#000000" -} diff --git a/static/manifest.webmanifest b/static/manifest.webmanifest index f77d93c7..edd56cd7 100644 --- a/static/manifest.webmanifest +++ b/static/manifest.webmanifest @@ -1,7 +1,7 @@ { "theme_color": "#fff", "background_color": "#000", - "display": "fullscreen", + "display": "standalone", "scope": "/", "start_url": "/", "name": "Coinos", diff --git a/static/service-worker.js b/static/service-worker.js new file mode 100644 index 00000000..7952231d --- /dev/null +++ b/static/service-worker.js @@ -0,0 +1,7 @@ +self.addEventListener('fetch', function(event) { + event.respondWith( + caches.match(event.request).then(function(response) { + return response || fetch(event.request); + }) + ); +}); |
