-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
42 lines (39 loc) · 1.05 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<html>
<head>
<script>
window.onload = function(){
const url = new URL(window.location.href)
var text;
if(url.searchParams.has("url")){
url_text = url.searchParams.get("url")
bodyText = "Redirecting you to: " + url_text
var success;
try {
window.location.replace(url_text);
success = true
} catch (e) {
try {
window.location.href = url_text;
success = true
} catch (e) {
bodyText = "Failed to redirect. Copy the url manually: " + url_text
success = false
}
}
} else {
bodyText = "No \"url\" parameter applied to URL."
success = false
}
const textnode = document.createTextNode(bodyText);
document.body.appendChild(textnode);
if(success){
setTimeout(function() {
window.close()
}, 5000);
}
}
</script>
</head>
<body>
</body>
</html>