Spaces:
Running
Running
Update index.html
Browse files- index.html +12 -4
index.html
CHANGED
@@ -10,20 +10,28 @@
|
|
10 |
<p id="result">Checking for proxy...</p>
|
11 |
|
12 |
<script>
|
13 |
-
// Function to check if the image fails to load
|
14 |
function checkProxy() {
|
15 |
var img = new Image();
|
|
|
|
|
|
|
16 |
img.onload = function() {
|
|
|
17 |
document.getElementById('result').innerText = 'No Proxy Detected';
|
18 |
};
|
|
|
19 |
img.onerror = function() {
|
|
|
20 |
document.getElementById('result').innerText = 'Proxy Detected';
|
21 |
};
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
24 |
}
|
25 |
|
26 |
-
// Run the proxy check
|
27 |
checkProxy();
|
28 |
</script>
|
29 |
</body>
|
|
|
10 |
<p id="result">Checking for proxy...</p>
|
11 |
|
12 |
<script>
|
|
|
13 |
function checkProxy() {
|
14 |
var img = new Image();
|
15 |
+
var timeout = 5000; // 5 seconds timeout
|
16 |
+
var timer;
|
17 |
+
|
18 |
img.onload = function() {
|
19 |
+
clearTimeout(timer);
|
20 |
document.getElementById('result').innerText = 'No Proxy Detected';
|
21 |
};
|
22 |
+
|
23 |
img.onerror = function() {
|
24 |
+
clearTimeout(timer);
|
25 |
document.getElementById('result').innerText = 'Proxy Detected';
|
26 |
};
|
27 |
+
|
28 |
+
timer = setTimeout(function() {
|
29 |
+
document.getElementById('result').innerText = 'Proxy Detection Timed Out';
|
30 |
+
}, timeout);
|
31 |
+
|
32 |
+
img.src = 'https://www.example.com/some-image.jpg'; // Replace with a valid image URL
|
33 |
}
|
34 |
|
|
|
35 |
checkProxy();
|
36 |
</script>
|
37 |
</body>
|