Skip to content

Commit 820ba44

Browse files
Create saving.js
1 parent 23d2cb8 commit 820ba44

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

edit/saving.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var url_string = window.location.href;
2+
var url = new URL(url_string);
3+
var d = url.searchParams.get("d");
4+
5+
setInterval(checkURL('https://kittenapps-films.github.io/GeoFS_Wiki/'+d), 500);
6+
7+
async function checkURL(url) {
8+
try {
9+
const response = await fetch(url);
10+
if (!response.ok) return console.log(`URL does not exist: ${url}`);
11+
window.location.replace('https://kittenapps-films.github.io/GeoFS_Wiki/'+d);
12+
} catch (error) {
13+
//go again
14+
}
15+
}

0 commit comments

Comments
 (0)