about summary refs log tree commit diff
path: root/app/javascript/mastodon/service_worker
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-07-03 19:50:18 +0200
committerGitHub <noreply@github.com>2018-07-03 19:50:18 +0200
commit5b6db8a62a4305806b6257a78e0a85d3f91fcc54 (patch)
tree0dc8e41d116bb0e85de2d216aa98be1dd56aaf89 /app/javascript/mastodon/service_worker
parent4045b50bd6f6194f41384c2426bd9b17831b1438 (diff)
Disable service worker media cache and IndexedDB storage (#7932)
Fix #7893
Fix #7615
Diffstat (limited to 'app/javascript/mastodon/service_worker')
-rw-r--r--app/javascript/mastodon/service_worker/entry.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/app/javascript/mastodon/service_worker/entry.js b/app/javascript/mastodon/service_worker/entry.js
index 17b05a837..b354f3b33 100644
--- a/app/javascript/mastodon/service_worker/entry.js
+++ b/app/javascript/mastodon/service_worker/entry.js
@@ -1,9 +1,9 @@
-import { freeStorage, storageFreeable } from '../storage/modifier';
+// import { freeStorage, storageFreeable } from '../storage/modifier';
 import './web_push_notifications';
 
-function openSystemCache() {
-  return caches.open('mastodon-system');
-}
+// function openSystemCache() {
+//   return caches.open('mastodon-system');
+// }
 
 function openWebCache() {
   return caches.open('mastodon-web');
@@ -13,8 +13,8 @@ function fetchRoot() {
   return fetch('/', { credentials: 'include', redirect: 'manual' });
 }
 
-const firefox = navigator.userAgent.match(/Firefox\/(\d+)/);
-const invalidOnlyIfCached = firefox && firefox[1] < 60;
+// const firefox = navigator.userAgent.match(/Firefox\/(\d+)/);
+// const invalidOnlyIfCached = firefox && firefox[1] < 60;
 
 // Cause a new version of a registered Service Worker to replace an existing one
 // that is already installed, and replace the currently active worker on open pages.
@@ -52,7 +52,7 @@ self.addEventListener('fetch', function(event) {
 
       return response;
     }));
-  } else if (storageFreeable && (ATTACHMENT_HOST ? url.host === ATTACHMENT_HOST : url.pathname.startsWith('/system/'))) {
+  } /* else if (storageFreeable && (ATTACHMENT_HOST ? url.host === ATTACHMENT_HOST : url.pathname.startsWith('/system/'))) {
     event.respondWith(openSystemCache().then(cache => {
       return cache.match(event.request.url).then(cached => {
         if (cached === undefined) {
@@ -73,5 +73,5 @@ self.addEventListener('fetch', function(event) {
         return cached;
       });
     }));
-  }
+  } */
 });