Fossil SCM

Do not require mouse events for auto-hyperlink if the UserAgent string includes "Android". Describe the Safari visited/unvisited link limitation on the auto-hyperlink setting.

drh 2022-02-12 13:55 trunk
Commit cef15ed3d3dcfefda6f38fab5cd04d70128315644749bd398a9b1e79ed145709
2 files changed +12 -2 +2 -1
+12 -2
--- src/setup.c
+++ src/setup.c
@@ -460,10 +460,13 @@
460460
@ This limit is only enforced on Unix servers. On Linux systems,
461461
@ access to the /proc virtual filesystem is required, which means this limit
462462
@ might not work inside a chroot() jail.
463463
@ (Property: "max-loadavg")</p>
464464
465
+ @ <hr />
466
+ @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
467
+
465468
@ <a id="autoh"></a>
466469
@ <hr />
467470
onoff_attribute(
468471
"Enable hyperlinks for \"nobody\" based on User-Agent and Javascript",
469472
"auto-hyperlink", "autohyperlink", 1, 0);
@@ -483,21 +486,28 @@
483486
@ You do not normally want a robot to walk your entire repository because
484487
@ if it does, your server will end up computing diffs and annotations for
485488
@ every historical version of every file and creating ZIPs and tarballs of
486489
@ every historical check-in, which can use a lot of CPU and bandwidth
487490
@ even for relatively small projects.</p>
491
+ @
492
+ @ <p>Limitation: Hyperlink visited/unvisited colors will not work
493
+ @ correctly with this option on Safari-based browsers. They work fine
494
+ @ on Chrome-based browsers and on Firefox, but not Safari. Since
495
+ @ Safari is the underlying rendering engine on all iPhones and iPads,
496
+ @ this means that hyperlink visited/unvisited colors will not operate
497
+ @ on those platforms when this option is enabled.</p>
488498
@
489499
@ <p>Additional parameters that control this behavior:</p>
490500
@ <blockquote>
491501
entry_attribute("Delay in milliseconds before enabling hyperlinks", 5,
492502
"auto-hyperlink-delay", "ah-delay", "50", 0);
493503
@ <br />
494
- onoff_attribute("Also require a mousedown event before enabling hyperlinks",
504
+ onoff_attribute("Also require a mouse event before enabling hyperlinks",
495505
"auto-hyperlink-mouseover", "ahmo", 0, 0);
496506
@ </blockquote>
497507
@ <p>For maximum robot defense, "Delay" should be at least 50 milliseconds
498
- @ and "require a mousedown event" should turned on. To test to see that
508
+ @ and "require a mouse event" should be turned on. To test to see that
499509
@ this mechanism is working, visit the <a href="%R/test_env">/test_env</a>
500510
@ page (from a separate web browser that is not logged in, even as
501511
@ "anonymous") and verify that the "g.javascriptHyperlink" value is "1".</p>
502512
@ <p>(Properties: "auto-hyperlink", "auto-hyperlink-delay", and
503513
@ "auto-hyperlink-mouseover"")</p>
504514
--- src/setup.c
+++ src/setup.c
@@ -460,10 +460,13 @@
460 @ This limit is only enforced on Unix servers. On Linux systems,
461 @ access to the /proc virtual filesystem is required, which means this limit
462 @ might not work inside a chroot() jail.
463 @ (Property: "max-loadavg")</p>
464
 
 
 
465 @ <a id="autoh"></a>
466 @ <hr />
467 onoff_attribute(
468 "Enable hyperlinks for \"nobody\" based on User-Agent and Javascript",
469 "auto-hyperlink", "autohyperlink", 1, 0);
@@ -483,21 +486,28 @@
483 @ You do not normally want a robot to walk your entire repository because
484 @ if it does, your server will end up computing diffs and annotations for
485 @ every historical version of every file and creating ZIPs and tarballs of
486 @ every historical check-in, which can use a lot of CPU and bandwidth
487 @ even for relatively small projects.</p>
 
 
 
 
 
 
 
488 @
489 @ <p>Additional parameters that control this behavior:</p>
490 @ <blockquote>
491 entry_attribute("Delay in milliseconds before enabling hyperlinks", 5,
492 "auto-hyperlink-delay", "ah-delay", "50", 0);
493 @ <br />
494 onoff_attribute("Also require a mousedown event before enabling hyperlinks",
495 "auto-hyperlink-mouseover", "ahmo", 0, 0);
496 @ </blockquote>
497 @ <p>For maximum robot defense, "Delay" should be at least 50 milliseconds
498 @ and "require a mousedown event" should turned on. To test to see that
499 @ this mechanism is working, visit the <a href="%R/test_env">/test_env</a>
500 @ page (from a separate web browser that is not logged in, even as
501 @ "anonymous") and verify that the "g.javascriptHyperlink" value is "1".</p>
502 @ <p>(Properties: "auto-hyperlink", "auto-hyperlink-delay", and
503 @ "auto-hyperlink-mouseover"")</p>
504
--- src/setup.c
+++ src/setup.c
@@ -460,10 +460,13 @@
460 @ This limit is only enforced on Unix servers. On Linux systems,
461 @ access to the /proc virtual filesystem is required, which means this limit
462 @ might not work inside a chroot() jail.
463 @ (Property: "max-loadavg")</p>
464
465 @ <hr />
466 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
467
468 @ <a id="autoh"></a>
469 @ <hr />
470 onoff_attribute(
471 "Enable hyperlinks for \"nobody\" based on User-Agent and Javascript",
472 "auto-hyperlink", "autohyperlink", 1, 0);
@@ -483,21 +486,28 @@
486 @ You do not normally want a robot to walk your entire repository because
487 @ if it does, your server will end up computing diffs and annotations for
488 @ every historical version of every file and creating ZIPs and tarballs of
489 @ every historical check-in, which can use a lot of CPU and bandwidth
490 @ even for relatively small projects.</p>
491 @
492 @ <p>Limitation: Hyperlink visited/unvisited colors will not work
493 @ correctly with this option on Safari-based browsers. They work fine
494 @ on Chrome-based browsers and on Firefox, but not Safari. Since
495 @ Safari is the underlying rendering engine on all iPhones and iPads,
496 @ this means that hyperlink visited/unvisited colors will not operate
497 @ on those platforms when this option is enabled.</p>
498 @
499 @ <p>Additional parameters that control this behavior:</p>
500 @ <blockquote>
501 entry_attribute("Delay in milliseconds before enabling hyperlinks", 5,
502 "auto-hyperlink-delay", "ah-delay", "50", 0);
503 @ <br />
504 onoff_attribute("Also require a mouse event before enabling hyperlinks",
505 "auto-hyperlink-mouseover", "ahmo", 0, 0);
506 @ </blockquote>
507 @ <p>For maximum robot defense, "Delay" should be at least 50 milliseconds
508 @ and "require a mouse event" should be turned on. To test to see that
509 @ this mechanism is working, visit the <a href="%R/test_env">/test_env</a>
510 @ page (from a separate web browser that is not logged in, even as
511 @ "anonymous") and verify that the "g.javascriptHyperlink" value is "1".</p>
512 @ <p>(Properties: "auto-hyperlink", "auto-hyperlink-delay", and
513 @ "auto-hyperlink-mouseover"")</p>
514
+2 -1
--- src/style.c
+++ src/style.c
@@ -883,11 +883,12 @@
883883
** Generate code to load all required javascript files.
884884
*/
885885
static void style_load_all_js_files(void){
886886
if( needHrefJs && g.perm.Hyperlink ){
887887
int nDelay = db_get_int("auto-hyperlink-delay",0);
888
- int bMouseover = db_get_boolean("auto-hyperlink-mouseover",0);
888
+ int bMouseover = db_get_boolean("auto-hyperlink-mouseover",0)
889
+ && sqlite3_strglob("*Android*",PD("HTTP_USER_AGENT",""));
889890
@ <script id='href-data' type='application/json'>\
890891
@ {"delay":%d(nDelay),"mouseover":%d(bMouseover)}</script>
891892
}
892893
@ <script nonce="%h(style_nonce())">/* style.c:%d(__LINE__) */
893894
@ function debugMsg(msg){
894895
--- src/style.c
+++ src/style.c
@@ -883,11 +883,12 @@
883 ** Generate code to load all required javascript files.
884 */
885 static void style_load_all_js_files(void){
886 if( needHrefJs && g.perm.Hyperlink ){
887 int nDelay = db_get_int("auto-hyperlink-delay",0);
888 int bMouseover = db_get_boolean("auto-hyperlink-mouseover",0);
 
889 @ <script id='href-data' type='application/json'>\
890 @ {"delay":%d(nDelay),"mouseover":%d(bMouseover)}</script>
891 }
892 @ <script nonce="%h(style_nonce())">/* style.c:%d(__LINE__) */
893 @ function debugMsg(msg){
894
--- src/style.c
+++ src/style.c
@@ -883,11 +883,12 @@
883 ** Generate code to load all required javascript files.
884 */
885 static void style_load_all_js_files(void){
886 if( needHrefJs && g.perm.Hyperlink ){
887 int nDelay = db_get_int("auto-hyperlink-delay",0);
888 int bMouseover = db_get_boolean("auto-hyperlink-mouseover",0)
889 && sqlite3_strglob("*Android*",PD("HTTP_USER_AGENT",""));
890 @ <script id='href-data' type='application/json'>\
891 @ {"delay":%d(nDelay),"mouseover":%d(bMouseover)}</script>
892 }
893 @ <script nonce="%h(style_nonce())">/* style.c:%d(__LINE__) */
894 @ function debugMsg(msg){
895

Keyboard Shortcuts

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