feat: implement version check and update dialog; add browser cache clearing functionality
Build and Deploy / build (push) Successful in 1m40s

This commit is contained in:
masoodafar-web
2025-12-27 04:47:27 +03:30
parent 51129704a0
commit 9cd275a777
6 changed files with 510 additions and 46 deletions
+23
View File
@@ -106,6 +106,29 @@
// اجرای اولیه (حتی اگر کاربر اسکرول نکرده)
requestAnimationFrame(update);
}
// پاک کردن کش مرورگر (Cache Storage و Service Worker)
window.clearBrowserCache = async function() {
// پاک کردن Cache Storage (Service Worker cache)
if ('caches' in window) {
const cacheNames = await caches.keys();
await Promise.all(
cacheNames.map(cacheName => caches.delete(cacheName))
);
console.log('Cache Storage cleared:', cacheNames.length, 'caches deleted');
}
// پاک کردن Service Worker registration
if ('serviceWorker' in navigator) {
const registrations = await navigator.serviceWorker.getRegistrations();
await Promise.all(
registrations.map(registration => registration.unregister())
);
console.log('Service Workers unregistered:', registrations.length);
}
return true;
};
</script>
</body>
</html>