diff --git a/includes/header.php b/includes/header.php index 1bf1d54f6..91f7090c7 100644 --- a/includes/header.php +++ b/includes/header.php @@ -37,6 +37,7 @@ > +
diff --git a/manifest.json b/manifest.json index ba0c331c9..6e16fff98 100644 --- a/manifest.json +++ b/manifest.json @@ -3,19 +3,35 @@ "name": "Wallos - Personal Subscription Tracker", "icons": [ { - "src": "images/icon/android-chrome-192x192", + "src": "images/icon/android-chrome-192x192.png", "type": "image/png", "sizes": "192x192" }, { - "src": "/images/icon/android-chrome-512x512", + "src": "/images/icon/android-chrome-512x512.png", "type": "image/png", "sizes": "512x512" + }, + { + "src": "images/icon/android-chrome-192x192.png", + "type": "image/png", + "sizes": "192x192", + "purpose": "maskable" + }, + { + "src": "/images/icon/android-chrome-512x512.png", + "type": "image/png", + "sizes": "512x512", + "purpose": "maskable" } ], - "start_url": "/", + "start_url": "/", + "id": "com.wallos.app", "background_color": "#FFFFFF", "display": "standalone", "scope": "/", - "theme_color": "#007bff" + "theme_color": "#FFFFFF", + "description": "Wallos is a personal subscription tracker that helps you keep track of your subscriptions and save money.", + "orientation": "portrait-primary", + "display_override": ["window-controls-overlay"] } \ No newline at end of file diff --git a/registration.php b/registration.php index 8954b9ab6..3f09c1058 100644 --- a/registration.php +++ b/registration.php @@ -97,6 +97,7 @@ function validate($value) { > +
diff --git a/scripts/all.js b/scripts/all.js new file mode 100644 index 000000000..21e599358 --- /dev/null +++ b/scripts/all.js @@ -0,0 +1,9 @@ +if ('serviceWorker' in navigator) { + window.addEventListener('load', function() { + navigator.serviceWorker.register('scripts/service-worker.js').then(function(registration) { + console.log('ServiceWorker registration successful with scope: ', registration.scope); + }, function(err) { + console.log('ServiceWorker registration failed: ', err); + }); + }); + } \ No newline at end of file diff --git a/scripts/dashboard.js b/scripts/dashboard.js index 8ba1e03bf..b0a235b41 100644 --- a/scripts/dashboard.js +++ b/scripts/dashboard.js @@ -316,14 +316,4 @@ document.addEventListener('DOMContentLoaded', function() { document.querySelector('#sort-options').addEventListener('focus', function() { isSortOptionsOpen = true; }); -}); - -if ('serviceWorker' in navigator) { - window.addEventListener('load', function() { - navigator.serviceWorker.register('scripts/service-worker.js').then(function(registration) { - console.log('ServiceWorker registration successful with scope: ', registration.scope); - }, function(err) { - console.log('ServiceWorker registration failed: ', err); - }); - }); -} \ No newline at end of file +}); \ No newline at end of file diff --git a/scripts/service-worker.js b/scripts/service-worker.js index 83d8d66aa..daddc6328 100644 --- a/scripts/service-worker.js +++ b/scripts/service-worker.js @@ -7,6 +7,7 @@ self.addEventListener('install', function(event) { '/stats.php', '/settings.php', '/about.php', + '/endpoints/subscriptions/get.php', '/styles/styles.css', '/styles/dark-theme.css', '/styles/font.css', @@ -28,6 +29,7 @@ self.addEventListener('install', function(event) { '/scripts/i18n/zh_cn.js', '/scripts/i18n/zh_tw.js', '/scripts/i18n/getlang.js', + '/images/*', ]); }) );