Fossil SCM

Attempt to make recent robot defense improvements portable to IE. I do not have access to IE and hence cannot test this, so the changes are mostly a guess. [forum:/forumpost/e18c040d32|Forum post e18c040d32].

drh 2025-08-19 16:35 trunk
Commit 3d32a109301d1cab482c6f48c4a7c3617aec3408db09a4c95c20a08a0fb006c7
2 files changed +2 -1 +2 -2
+2 -1
--- src/href.js
+++ src/href.js
@@ -18,11 +18,12 @@
1818
** until the first mousedown event that occurs after the timer expires.
1919
*/
2020
var antiRobot = 0;
2121
function antiRobotGo(){
2222
if( antiRobot!=3 ) return;
23
- if( window.getComputedStyle(document.body).zIndex==='0' ){
23
+ var z = window.getComputedStyle(document.body).zIndex;
24
+ if( z==='0' || z===0 ){
2425
antiRobot = 7;
2526
var anchors = document.getElementsByTagName("a");
2627
for(var i=0; i<anchors.length; i++){
2728
var j = anchors[i];
2829
if(j.hasAttribute("data-href")) j.href=j.getAttribute("data-href");
2930
--- src/href.js
+++ src/href.js
@@ -18,11 +18,12 @@
18 ** until the first mousedown event that occurs after the timer expires.
19 */
20 var antiRobot = 0;
21 function antiRobotGo(){
22 if( antiRobot!=3 ) return;
23 if( window.getComputedStyle(document.body).zIndex==='0' ){
 
24 antiRobot = 7;
25 var anchors = document.getElementsByTagName("a");
26 for(var i=0; i<anchors.length; i++){
27 var j = anchors[i];
28 if(j.hasAttribute("data-href")) j.href=j.getAttribute("data-href");
29
--- src/href.js
+++ src/href.js
@@ -18,11 +18,12 @@
18 ** until the first mousedown event that occurs after the timer expires.
19 */
20 var antiRobot = 0;
21 function antiRobotGo(){
22 if( antiRobot!=3 ) return;
23 var z = window.getComputedStyle(document.body).zIndex;
24 if( z==='0' || z===0 ){
25 antiRobot = 7;
26 var anchors = document.getElementsByTagName("a");
27 for(var i=0; i<anchors.length; i++){
28 var j = anchors[i];
29 if(j.hasAttribute("data-href")) j.href=j.getAttribute("data-href");
30
+2 -2
--- src/robot.c
+++ src/robot.c
@@ -213,14 +213,14 @@
213213
@ function aaa(x){return document.getElementById(x);}\
214214
@ function bbb(h,a){\
215215
@ aaa("x4").value=h;\
216216
@ if((a%%75)==0){\
217217
@ aaa("x2").textContent=aaa("x2").textContent+".";\
218
- @ }\
218
+ @ }var z;\
219219
@ if(a>0){\
220220
@ setTimeout(bbb,1,h+a,a-1);\
221
- @ }else if(window.getComputedStyle(document.body).zIndex==='0'){\
221
+ @ }else if((z=window.getComputedStyle(document.body).zIndex)==='0'||z===0){\
222222
@ aaa("x3").style.visibility="visible";\
223223
@ aaa("x2").textContent="";\
224224
@ aaa("x1").textContent="All clear";\
225225
@ aaa("x6").onsubmit=function(){aaa("x3").style.visibility="hidden";};\
226226
@ aaa("x5").focus();\
227227
--- src/robot.c
+++ src/robot.c
@@ -213,14 +213,14 @@
213 @ function aaa(x){return document.getElementById(x);}\
214 @ function bbb(h,a){\
215 @ aaa("x4").value=h;\
216 @ if((a%%75)==0){\
217 @ aaa("x2").textContent=aaa("x2").textContent+".";\
218 @ }\
219 @ if(a>0){\
220 @ setTimeout(bbb,1,h+a,a-1);\
221 @ }else if(window.getComputedStyle(document.body).zIndex==='0'){\
222 @ aaa("x3").style.visibility="visible";\
223 @ aaa("x2").textContent="";\
224 @ aaa("x1").textContent="All clear";\
225 @ aaa("x6").onsubmit=function(){aaa("x3").style.visibility="hidden";};\
226 @ aaa("x5").focus();\
227
--- src/robot.c
+++ src/robot.c
@@ -213,14 +213,14 @@
213 @ function aaa(x){return document.getElementById(x);}\
214 @ function bbb(h,a){\
215 @ aaa("x4").value=h;\
216 @ if((a%%75)==0){\
217 @ aaa("x2").textContent=aaa("x2").textContent+".";\
218 @ }var z;\
219 @ if(a>0){\
220 @ setTimeout(bbb,1,h+a,a-1);\
221 @ }else if((z=window.getComputedStyle(document.body).zIndex)==='0'||z===0){\
222 @ aaa("x3").style.visibility="visible";\
223 @ aaa("x2").textContent="";\
224 @ aaa("x1").textContent="All clear";\
225 @ aaa("x6").onsubmit=function(){aaa("x3").style.visibility="hidden";};\
226 @ aaa("x5").focus();\
227

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button