Fossil

Check-in [cef15ed3]
Login

Check-in [cef15ed3]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: cef15ed3d3dcfefda6f38fab5cd04d70128315644749bd398a9b1e79ed145709
User & Date: drh 2022-02-12 13:55:30
Context
2022-02-12
20:30
Enhancement to robot defense. The auto-hyperlink setting can now be 2 (UserAgent only) in which case the UserAgent string is consulted and hyperlinks are generated if and only if the UserAgent looks human. Javascript does not come into play. When auto-hyperlink is 1, the traditional Javascript changes to href= in anchor tags are still used. ... (check-in: df337eb6 user: drh tags: trunk)
19:53
An attepmt to fix the <base href="..."> element of webpages so that the value of href attribute matches the URL being served. This should fix "#fragment" hyperlinks on all pages where these were broken (all except /doc). The values for /wiki and /info were left unchanged (it's yet unclear if they should also be changed). ... (check-in: 03b39f1d user: george tags: base-href-fix)
13:55
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. ... (check-in: cef15ed3 user: drh tags: trunk)
13:29
New javascript for href.js such that any mousemove or mousedown event at any time is sufficient to trigger the mouse activity condition for activation of hyperlinks. This works better on FF and chrome, but with safari, the visited/unvisited link color is determined by the initial value of href= and is not adjusted when href= changes, so visited/unvisited colors are not being updated on safari. ... (check-in: e7d67b76 user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/setup.c.

458
459
460
461
462
463
464



465
466
467
468
469
470
471
  @ computer is too large.  Set the threshold for disallowing expensive
  @ computations here.  Set this to 0.0 to disable the load average limit.
  @ This limit is only enforced on Unix servers.  On Linux systems,
  @ access to the /proc virtual filesystem is required, which means this limit
  @ might not work inside a chroot() jail.
  @ (Property: "max-loadavg")</p>




  @ <a id="autoh"></a>
  @ <hr />
  onoff_attribute(
      "Enable hyperlinks for \"nobody\" based on User-Agent and Javascript",
      "auto-hyperlink", "autohyperlink", 1, 0);
  @ <p>Enable hyperlinks (the equivalent of the "h" permission) for all users,
  @ including user "nobody", as long as







>
>
>







458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
  @ computer is too large.  Set the threshold for disallowing expensive
  @ computations here.  Set this to 0.0 to disable the load average limit.
  @ This limit is only enforced on Unix servers.  On Linux systems,
  @ access to the /proc virtual filesystem is required, which means this limit
  @ might not work inside a chroot() jail.
  @ (Property: "max-loadavg")</p>

  @ <hr />
  @ <p><input type="submit"  name="submit" value="Apply Changes" /></p>

  @ <a id="autoh"></a>
  @ <hr />
  onoff_attribute(
      "Enable hyperlinks for \"nobody\" based on User-Agent and Javascript",
      "auto-hyperlink", "autohyperlink", 1, 0);
  @ <p>Enable hyperlinks (the equivalent of the "h" permission) for all users,
  @ including user "nobody", as long as
481
482
483
484
485
486
487







488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
  @ <p>This setting is designed to give easy access to humans while
  @ keeping out robots and spiders.
  @ You do not normally want a robot to walk your entire repository because
  @ if it does, your server will end up computing diffs and annotations for
  @ every historical version of every file and creating ZIPs and tarballs of
  @ every historical check-in, which can use a lot of CPU and bandwidth
  @ even for relatively small projects.</p>







  @
  @ <p>Additional parameters that control this behavior:</p>
  @ <blockquote>
  entry_attribute("Delay in milliseconds before enabling hyperlinks", 5,
                  "auto-hyperlink-delay", "ah-delay", "50", 0);
  @ <br />
  onoff_attribute("Also require a mousedown event before enabling hyperlinks",
                  "auto-hyperlink-mouseover", "ahmo", 0, 0);
  @ </blockquote>
  @ <p>For maximum robot defense, "Delay" should be at least 50 milliseconds
  @ and "require a mousedown event" should turned on.  To test to see that
  @ this mechanism is working, visit the <a href="%R/test_env">/test_env</a>
  @ page (from a separate web browser that is not logged in, even as
  @ "anonymous") and verify that the "g.javascriptHyperlink" value is "1".</p>
  @ <p>(Properties: "auto-hyperlink", "auto-hyperlink-delay", and
  @ "auto-hyperlink-mouseover"")</p>

  @ <hr />







>
>
>
>
>
>
>






|



|







484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
  @ <p>This setting is designed to give easy access to humans while
  @ keeping out robots and spiders.
  @ You do not normally want a robot to walk your entire repository because
  @ if it does, your server will end up computing diffs and annotations for
  @ every historical version of every file and creating ZIPs and tarballs of
  @ every historical check-in, which can use a lot of CPU and bandwidth
  @ even for relatively small projects.</p>
  @
  @ <p>Limitation: Hyperlink visited/unvisited colors will not work
  @ correctly with this option on Safari-based browsers.  They work fine
  @ on Chrome-based browsers and on Firefox, but not Safari.  Since
  @ Safari is the underlying rendering engine on all iPhones and iPads,
  @ this means that hyperlink visited/unvisited colors will not operate
  @ on those platforms when this option is enabled.</p>
  @
  @ <p>Additional parameters that control this behavior:</p>
  @ <blockquote>
  entry_attribute("Delay in milliseconds before enabling hyperlinks", 5,
                  "auto-hyperlink-delay", "ah-delay", "50", 0);
  @ <br />
  onoff_attribute("Also require a mouse event before enabling hyperlinks",
                  "auto-hyperlink-mouseover", "ahmo", 0, 0);
  @ </blockquote>
  @ <p>For maximum robot defense, "Delay" should be at least 50 milliseconds
  @ and "require a mouse event" should be turned on.  To test to see that
  @ this mechanism is working, visit the <a href="%R/test_env">/test_env</a>
  @ page (from a separate web browser that is not logged in, even as
  @ "anonymous") and verify that the "g.javascriptHyperlink" value is "1".</p>
  @ <p>(Properties: "auto-hyperlink", "auto-hyperlink-delay", and
  @ "auto-hyperlink-mouseover"")</p>

  @ <hr />

Changes to src/style.c.

881
882
883
884
885
886
887
888

889
890
891
892
893
894
895

/*
** Generate code to load all required javascript files.
*/
static void style_load_all_js_files(void){
  if( needHrefJs && g.perm.Hyperlink ){
    int nDelay = db_get_int("auto-hyperlink-delay",0);
    int bMouseover = db_get_boolean("auto-hyperlink-mouseover",0);

    @ <script id='href-data' type='application/json'>\
    @ {"delay":%d(nDelay),"mouseover":%d(bMouseover)}</script>
  }
  @ <script nonce="%h(style_nonce())">/* style.c:%d(__LINE__) */
  @ function debugMsg(msg){
  @ var n = document.getElementById("debugMsg");
  @ if(n){n.textContent=msg;}







|
>







881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896

/*
** Generate code to load all required javascript files.
*/
static void style_load_all_js_files(void){
  if( needHrefJs && g.perm.Hyperlink ){
    int nDelay = db_get_int("auto-hyperlink-delay",0);
    int bMouseover = db_get_boolean("auto-hyperlink-mouseover",0)
                   && sqlite3_strglob("*Android*",PD("HTTP_USER_AGENT",""));
    @ <script id='href-data' type='application/json'>\
    @ {"delay":%d(nDelay),"mouseover":%d(bMouseover)}</script>
  }
  @ <script nonce="%h(style_nonce())">/* style.c:%d(__LINE__) */
  @ function debugMsg(msg){
  @ var n = document.getElementById("debugMsg");
  @ if(n){n.textContent=msg;}