summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-05-03 08:22:44 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-05-03 08:22:44 +0900
commit289c76a8020477d0361bdc5b5dadc06b2df75a9a (patch)
treefd12bd00aa9ce7b7b10e1dae8433b14f85aab525 /src/client
parent11.9.0 (diff)
downloadmisskey-289c76a8020477d0361bdc5b5dadc06b2df75a9a.tar.gz
misskey-289c76a8020477d0361bdc5b5dadc06b2df75a9a.tar.bz2
misskey-289c76a8020477d0361bdc5b5dadc06b2df75a9a.zip
Disable ServiceWorker
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/mios.ts7
-rw-r--r--src/client/app/sw.js36
2 files changed, 4 insertions, 39 deletions
diff --git a/src/client/app/mios.ts b/src/client/app/mios.ts
index 191b72e5bf..3ebee35804 100644
--- a/src/client/app/mios.ts
+++ b/src/client/app/mios.ts
@@ -173,9 +173,10 @@ export default class MiOS extends EventEmitter {
// Init service worker
if (this.shouldRegisterSw) {
- this.getMeta().then(data => {
- this.registerSw(data.swPublickey);
- });
+ // #4813
+ //this.getMeta().then(data => {
+ // this.registerSw(data.swPublickey);
+ //});
}
};
diff --git a/src/client/app/sw.js b/src/client/app/sw.js
index ccf6dc818e..92f2ac8284 100644
--- a/src/client/app/sw.js
+++ b/src/client/app/sw.js
@@ -3,12 +3,6 @@
*/
import composeNotification from './common/scripts/compose-notification';
-import { erase } from '../../prelude/array';
-
-// キャッシュするリソース
-const cachee = [
- '/'
-];
// インストールされたとき
self.addEventListener('install', ev => {
@@ -16,31 +10,9 @@ self.addEventListener('install', ev => {
ev.waitUntil(Promise.all([
self.skipWaiting(), // Force activate
- caches.open(_VERSION_).then(cache => cache.addAll(cachee)) // Cache
]));
});
-// アクティベートされたとき
-self.addEventListener('activate', ev => {
- // Clean up old caches
- ev.waitUntil(
- caches.keys().then(keys => Promise.all(
- erase(_VERSION_, keys)
- .map(key => caches.delete(key))
- ))
- );
-});
-
-// リクエストが発生したとき
-self.addEventListener('fetch', ev => {
- ev.respondWith(
- // キャッシュがあるか確認してあればそれを返す
- caches.match(ev.request).then(response =>
- response || fetch(ev.request)
- )
- );
-});
-
// プッシュ通知を受け取ったとき
self.addEventListener('push', ev => {
// クライアント取得
@@ -59,11 +31,3 @@ self.addEventListener('push', ev => {
});
}));
});
-
-self.addEventListener('message', ev => {
- if (ev.data == 'clear') {
- caches.keys().then(keys => {
- for (const key of keys) caches.delete(key);
- });
- }
-});