Skip to content

Commit cadf415

Browse files
author
benja2998
committed
wiki: add cookies
1 parent 84c51fe commit cadf415

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

antibot.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@
5050
`;
5151
};
5252

53+
54+
// check if the user is a human by checking if the cookie is set
55+
if (document.cookie.includes("isHuman=true")) {
56+
hiddenElements.forEach(el => el.style.display = "");
57+
statusDiv.textContent = "";
58+
return;
59+
}
60+
5361
updateTimerAndHash();
5462
const interval = setInterval(updateTimerAndHash, 100);
5563

@@ -60,6 +68,8 @@
6068
if (solvedNonce !== null) {
6169
hiddenElements.forEach(el => el.style.display = "");
6270
statusDiv.textContent = "";
71+
// store a cookie to remember the user is human
72+
document.cookie = "isHuman=true; path=/";
6373
} else {
6474
statusDiv.textContent = "Access denied. If you are a human, please try again later.";
6575
hiddenElements.forEach(el => el.innerHTML = "");

0 commit comments

Comments
 (0)