support multiple hosts - by qwencoder

This commit is contained in:
2026-01-18 11:40:09 -05:00
parent 8d7834b38f
commit 769dffb4b5
2 changed files with 44 additions and 11 deletions

View File

@@ -3,7 +3,7 @@
<head>
<link rel="icon" href="data:;base64,iVBORw0KGgo=" />
<script>
// Load local storage from server on page load
(async () => {
const resp = await fetch("loadLS");
const lsItems = JSON.parse(await resp.text());
@@ -13,6 +13,8 @@
console.log("Loaded local storage");
})();
// Function to save local storage to server
// This function is called periodically to sync localStorage with server
function postLocalStorage() {
(async () => {
const resp = await fetch("saveLS", {
@@ -26,6 +28,7 @@
})();
}
// Set up periodic saving every 10 minutes
setInterval(postLocalStorage, 10 * 60 * 1000) // 10 mins
</script>