This commit is contained in:
syuilo
2017-11-28 16:10:31 +09:00
parent 94434bd69e
commit c157644110
3 changed files with 42 additions and 1 deletions

View File

@@ -2,6 +2,13 @@ const yn = window.confirm(
'サーバー上に存在しないスクリプトがリクエストされました。お使いのMisskeyのバージョンが古いことが原因の可能性があります。Misskeyを更新しますか');
if (yn) {
// Clear cache (serive worker)
try {
navigator.serviceWorker.controller.postMessage('clear');
} catch (e) {
console.error(e);
}
location.reload(true);
} else {
alert('問題が解決しない場合はサーバー管理者までお問い合せください。');

View File

@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Misskeyのリカバリ</title>
<script>
const yn = window.confirm('キャッシュをクリアしますか?\y\yDo you want to clear caches?');
if (yn) {
try {
navigator.serviceWorker.controller.postMessage('clear');
navigator.serviceWorker.getRegistrations().then(registrations => {
registrations.forEach(registration => registration.unregister());
});
} catch (e) {
console.error(e);
}
localStorage.setItem('should-refresh', 'true');
alert('キャッシュをクリアしました。');
} else {
alert('問題が解決しない場合はサーバー管理者までお問い合せください。');
}
</script>
</head>
</html>