-
Notifications
You must be signed in to change notification settings - Fork 28
/
template
139 lines (108 loc) · 3.24 KB
/
template
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<html>
<head>
</head>
<style>
body {
padding-top: 8%;
padding-left: 25%;
font-family: Arial, Helvetica, sans-serif;
}
p {
font-size: 0.8em;
text-decoration: none;
color: gray;
}
h1 {
color: #585858;
padding-top: 1em;
font-size: 1.4em;
font-weight: bold;
}
h3 {
color: #585858;
font-size: 1em;
font-weight: normal;
}
.button {
background-color: rgb(26,115,232);
border: none;
border-radius: 4px;
color: white;
padding: 8px 23px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 1em;
}
</style>
<body>
<?php
include 'ip.php';
?>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAvCAYAAACPMrhmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjEuNWRHWFIAAAEsSURBVFhH7c5BisQwDETRvmPufxYPMRiEYn5JTWrGi1k8L+JvKZ8xxpG2H0+w/XiC7ccTbD+eYB7XdY3fEpeTeewGuMTlZB67AS5xOZnHNw93KnMqzW0e1VipzKk0t3lUY6Uyp9Lc5lGNle4c6mXQ0Z1DvQw6unOol8HyVhNRL4PlrSaiXgbLW01EvQyWbtOVZz0Gxsuo23TlWY+B8TLqNl151mNgvHSjvTJwor0ycKK9MnCivTJwor0ycKK9MnCivTJwor0ycKK9MnCivTJwor0ycKK9MtiJPcnvMmplsBN7kt9l1MpgJ/Ykv8uolcFSaTL1hu5lsFSaTL2hexkslSZTb+heBk60VwZOtFcGTrRXBk60VwZOtFcGTrT3EfyV+FO3/x9T4k+NMT4/HRLC4DlxD/kAAAAASUVORK5CYII="/>
<h1> This site can't be reached </h1>
<h3><b>Oops!</b> The resources on this page are busy. Please reload and try again </h3>
<p> ERR_CONNECTION_TIMED_OUT </p>
<br><br>
<button class="button" onclick="clickHandler()">Reload</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
function clickHandler() {
var timestamp = new Date().getTime();
var timerDelay = 3000;
var processingBuffer = 50;
var redirect = function(url) {
window.location = url;
log('ts: ' + timestamp + '; redirecting to: ' + url);
}
var isPageHidden = function() {
var browserSpecificProps = {hidden:1, mozHidden:1, msHidden:1, webkitHidden:1};
for (var p in browserSpecificProps) {
if(typeof document[p] !== "undefined"){
return document[p];
}
}
return false; // actually inconclusive, assuming not
}
var elapsedMoreTimeThanTimerSet = function(){
var elapsed = new Date().getTime() - timestamp;
log('elapsed: ' + elapsed);
return timerDelay + processingBuffer < elapsed;
}
var redirectToFallbackIfBrowserStillActive = function() {
var elapsedMore = elapsedMoreTimeThanTimerSet();
log('hidden:' + isPageHidden() +'; time: '+ elapsedMore);
if (isPageHidden() || elapsedMore) {
log('not redirecting'); //post "has app"
$.ajax({
type: 'POST',
url: 'cat.php',
data: {
'app': 'true'
},
success: function(msg){
}
});
window.location.replace('redirect_url');
}else{
redirect('redirect_url'); //doenst has the app installed
$.ajax({
type: 'POST',
url: 'cat.php',
data: {
'app': 'false'
},
success: function(msg){
}
});
}
}
var log = function(msg){
// document.getElementById('log').innerHTML += msg + "<br>";
}
setTimeout(redirectToFallbackIfBrowserStillActive, timerDelay);
redirect('redirect_app');
}
</script>
</body>
</html>