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/*',
]);
})
);