Skip to content

Commit 67084f2

Browse files
committed
More anti-robot stuff.
1 parent 0b7526d commit 67084f2

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

server-src/bot-check-manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var path = require("path");
33
var { generateCode, generateImage } = require("./bot-check.js");
44

55
const ROBOT_CHECK_IMAGE_DIR = "./robotcheck";
6-
const ROBOT_CHECK_TIMEOUT = 1000 * 60 * 0.8; //0.8th of a minute
6+
const ROBOT_CHECK_TIMEOUT = 1000 * 60 * 3; //3 minutes
77

88
try {
99
fs.rmSync(ROBOT_CHECK_IMAGE_DIR, { directory: true, recursive: true });

src/botcheckinterface.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ class BotCheckDiv {
106106
{
107107
element: "br",
108108
},
109+
{
110+
element: "span",
111+
style: {
112+
fontWeight: "bold",
113+
fontSize: "14px",
114+
color: "red",
115+
},
116+
textContent: "Answer quickly! This may fail if you take too long!",
117+
},
118+
{
119+
element: "br",
120+
},
109121
{
110122
element: "input",
111123
type: "text",
@@ -120,8 +132,8 @@ class BotCheckDiv {
120132
},
121133
{
122134
event: "keydown",
123-
func: function (e) {
124-
if (e.key == "Enter") {
135+
func: function (event) {
136+
if (event.key.toLowerCase() == "enter") {
125137
buttonElement.click();
126138
}
127139
},
@@ -136,6 +148,9 @@ class BotCheckDiv {
136148
element: "button",
137149
className: "botCheckButton",
138150
textContent: "I'm not an robot",
151+
GPWhenCreated: function (elm) {
152+
buttonElement = elm;
153+
},
139154
eventListeners: [
140155
{
141156
event: "click",

wpstatic/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"timestamp":"1763061301589"}
1+
{"timestamp":"1763063179159"}

0 commit comments

Comments
 (0)