-
Notifications
You must be signed in to change notification settings - Fork 542
/
reset.html
65 lines (54 loc) · 1.53 KB
/
reset.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reset Me | Civitai</title>
<style>
body {
background: #111;
color: #ccc;
width: 350px;
margin: 40px auto;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
button {
width: 100%;
height: 48px;
background: #3498db;
color: #fff;
font-weight: 500;
text-transform: uppercase;
font-size: 1.1em;
cursor: pointer;
}
.small {
font-size: 0.8em;
margin-top: 10px;
}
</style>
</head>
<body>
<h1>Reset Me</h1>
<p>Having trouble with the site? Here's a little button you can press to try and get unstuck:</p>
<button>Run Clean-up</button>
<p class="small">You will be redirected to the homepage after completion</p>
</body>
<script>
const button = document.querySelector('button');
button.addEventListener('click', async () => {
button.innerHTML = 'Running...';
// Clear indexedDB
const dbNames = ['keyval-store', 'tensorflowjs'];
for (const dbName of dbNames) window.indexedDB.deleteDatabase(dbName);
// Clear cache
const cache = await caches.keys();
cache.forEach((key) => caches.delete(key));
// Clear local storage
localStorage.clear();
window.location.href = '/';
});
</script>
</html>