mirror of
https://gitlab.com/vyla-entertainment/documentation.git
synced 2026-11-14 06:27:23 -05:00
updated manifest, and added a reset path
This commit is contained in:
34
reset/index.html
Normal file
34
reset/index.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<script>
|
||||
(async () => {
|
||||
localStorage.clear();
|
||||
sessionStorage.clear();
|
||||
|
||||
if ("caches" in window) {
|
||||
const caches = await window.caches.keys();
|
||||
await Promise.all(caches.map(name => window.caches.delete(name)));
|
||||
}
|
||||
|
||||
if ("indexedDB" in window && indexedDB.databases) {
|
||||
const databases = await indexedDB.databases();
|
||||
|
||||
await Promise.all(
|
||||
databases
|
||||
.map(db => db.name)
|
||||
.filter(Boolean)
|
||||
.map(name => new Promise(resolve => {
|
||||
const request = indexedDB.deleteDatabase(name);
|
||||
request.onsuccess = request.onerror = request.onblocked = resolve;
|
||||
}))
|
||||
);
|
||||
}
|
||||
|
||||
if (navigator.serviceWorker) {
|
||||
const registrations = await navigator.serviceWorker.getRegistrations();
|
||||
await Promise.all(
|
||||
registrations.map(registration => registration.unregister())
|
||||
);
|
||||
}
|
||||
|
||||
location.replace("/");
|
||||
})();
|
||||
</script>
|
||||
Reference in New Issue
Block a user