-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
120 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,7 @@ | |
} | ||
link.href = url; | ||
} | ||
|
||
function GetBaseUrl() { | ||
return window.location.origin + window.location.pathname; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
async function FetchVersionFromServer() { | ||
try { | ||
// Append a timestamp to the URL to prevent caching | ||
const timestamp = new Date().getTime(); | ||
const response = await fetch(`/version.json?t=${timestamp}`); | ||
const data = await response.json(); | ||
return data.version; | ||
} catch (error) { | ||
console.error('Error fetching version:', error); | ||
return null; | ||
} | ||
} | ||
|
||
async function ClearCacheAndReload() { | ||
if ('caches' in window) { | ||
// Clear all the cache storage | ||
const cacheNames = await caches.keys(); | ||
await Promise.all(cacheNames.map(cacheName => caches.delete(cacheName))); | ||
} | ||
|
||
// Reload the page | ||
window.location.reload(true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"version": "2.71" | ||
} |