You've already forked remote-local-storage
initial commit
This commit is contained in:
46
wrap.html
Normal file
46
wrap.html
Normal file
@ -0,0 +1,46 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="icon" href="data:;base64,iVBORw0KGgo=" />
|
||||
<script>
|
||||
|
||||
(async () => {
|
||||
const resp = await fetch("loadLS");
|
||||
const lsItems = JSON.parse(await resp.text());
|
||||
for (const key in lsItems) {
|
||||
localStorage.setItem(key, lsItems[key])
|
||||
}
|
||||
console.log("Loaded local storage");
|
||||
})();
|
||||
|
||||
function postLocalStorage() {
|
||||
(async () => {
|
||||
const resp = await fetch("saveLS", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(localStorage),
|
||||
});
|
||||
console.log(await resp.text());
|
||||
})();
|
||||
}
|
||||
|
||||
setInterval(postLocalStorage, 10 * 60 * 1000) // 10 mins
|
||||
|
||||
</script>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
iframe {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<iframe src="/"></iframe>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user