-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathip_block.txt
71 lines (68 loc) · 2.18 KB
/
ip_block.txt
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
<script>
(function() {
if (window.location.pathname === '/privacy-policy') {
document.body.style.display = 'block';
return;
}
var SKIP_IPS = [
'194.36.97.35',
'3.234.167.213',
'35.172.28.62',
'204.236.228.46',
'212.59.69.49',
'131.226.33.187',
'131.226.37.142',
'131.226.36.220',
'207.246.76.16',
'137.184.96.144',
'207.148.23.222',
'198.199.115.68',
'198.199.104.192',
'159.223.90.105',
'68.183.127.24',
'198.199.114.16',
'131.226.46.176',
'64.226.132.218',];
var overlay = document.getElementById('usPromptOverlay');
var yesButton = document.getElementById('usYesButton');
var noButton = document.getElementById('usNoButton');
document.body.style.display = 'none';
fetch("https://ipwhois.pro/?key=fYIjS7zoAaEfTp66")
.then(function(response) { return response.json(); })
.then(function(data) {
var skipCheck = SKIP_IPS.includes(data.ip);
if (!skipCheck && data.country_code === "US") {
localStorage.setItem("clientIsUSBased", "true");
window.location.href = "https://portal.hashnote.com";
return;
}
var clientIsUSBased = localStorage.getItem("clientIsUSBased");
if (skipCheck) {
localStorage.removeItem("clientIsUSBased");
overlay.style.display = "flex";
} else {
if (clientIsUSBased === null) {
overlay.style.display = "flex";
} else if (clientIsUSBased === "true") {
window.location.href = "https://portal.hashnote.com";
return;
} else {
overlay.style.display = "none";
}
}
document.body.style.display = 'block';
})
.catch(function() {
overlay.style.display = "flex";
document.body.style.display = 'block';
});
yesButton.addEventListener("click", function() {
localStorage.setItem("clientIsUSBased", "true");
window.location.href = "https://portal.hashnote.com";
});
noButton.addEventListener("click", function() {
localStorage.setItem("clientIsUSBased", "false");
overlay.style.display = "none";
});
})();
</script>