diff --git a/scripts/all.js b/scripts/all.js
new file mode 100644
index 0000000..159234b
--- /dev/null
+++ b/scripts/all.js
@@ -0,0 +1,9 @@
+if ('serviceWorker' in navigator) {
+ window.addEventListener('load', function() {
+ navigator.serviceWorker.register('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 d2b2596..b0a235b 100644
--- a/scripts/dashboard.js
+++ b/scripts/dashboard.js
@@ -316,4 +316,4 @@ document.addEventListener('DOMContentLoaded', function() {
document.querySelector('#sort-options').addEventListener('focus', function() {
isSortOptionsOpen = true;
});
-});
+});
\ No newline at end of file
diff --git a/service-worker.js b/service-worker.js
new file mode 100644
index 0000000..32b0d90
--- /dev/null
+++ b/service-worker.js
@@ -0,0 +1,44 @@
+self.addEventListener('install', function(event) {
+ event.waitUntil(
+ caches.open('my-cache').then(function(cache) {
+ return cache.addAll([
+ '.',
+ 'index.php',
+ 'stats.php',
+ 'settings.php',
+ 'about.php',
+ 'endpoints/subscriptions/get.php',
+ 'styles/styles.css',
+ 'styles/dark-theme.css',
+ 'styles/login.css',
+ 'scripts/common.js',
+ 'scripts/dashboard.js',
+ 'scripts/stats.js',
+ 'scripts/settings.js',
+ 'scripts/registration.js',
+ 'scripts/i18n/en.js',
+ 'scripts/i18n/de.js',
+ 'scripts/i18n/el.js',
+ 'scripts/i18n/es.js',
+ 'scripts/i18n/fr.js',
+ 'scripts/i18n/jp.js',
+ 'scripts/i18n/pt.js',
+ 'scripts/i18n/tr.js',
+ 'scripts/i18n/zh_cn.js',
+ 'scripts/i18n/zh_tw.js',
+ 'scripts/i18n/getlang.js',
+ 'images/icon/favicon.ico',
+ 'images/wallossolid.png',
+ 'images/wallossolidwhite.png',
+ ]);
+ })
+ );
+});
+
+self.addEventListener('fetch', function(event) {
+ event.respondWith(
+ caches.match(event.request).then(function(response) {
+ return response || fetch(event.request);
+ })
+ );
+});
\ No newline at end of file