Index: src/href.js ================================================================== --- src/href.js +++ src/href.js @@ -31,13 +31,11 @@ } function antiRobotDefense(){ var x = document.getElementById("href-data"); var jx = x.textContent || x.innerText; var g = JSON.parse(jx); - var isOperaMini = - Object.prototype.toString.call(window.operamini)==="[object OperaMini]"; - if(g.mouseover && !isOperaMini){ + if(g.mouseover){ document.getElementsByTagName("body")[0].onmousemove=function(){ setTimeout(setAllHrefs, g.delay); } }else{ setTimeout(setAllHrefs, g.delay); Index: src/login.c ================================================================== --- src/login.c +++ src/login.c @@ -444,10 +444,21 @@ if( strncmp(zAgent, "Safari/", 7)==0 ) return 1; if( strncmp(zAgent, "Lynx/", 5)==0 ) return 1; if( strncmp(zAgent, "NetSurf/", 8)==0 ) return 1; return 0; } + +/* +** Look at the HTTP_USER_AGENT parameter and try to determine if the user agent +** is a mobile device that does not normally have a mouse. +*/ +static int isMobile(const char *zAgent){ + if( sqlite3_strglob("*Mobile/*", zAgent)==0 ) return 1; + if( sqlite3_strglob("*Tablet;*", zAgent)==0 ) return 1; + return 0; +} + /* ** COMMAND: test-ishuman ** ** Read lines of text from standard input. Interpret each line of text @@ -1112,14 +1123,19 @@ if( fossil_strcmp(g.zLogin,"nobody")==0 ){ g.zLogin = 0; } if( PB("isrobot") ){ g.isHuman = 0; - }else if( g.zLogin==0 ){ - g.isHuman = isHuman(P("HTTP_USER_AGENT")); + g.isMobile = 0; }else{ - g.isHuman = 1; + const char *zAgent = P("HTTP_USER_AGENT"); + if( g.zLogin==0 ){ + g.isHuman = isHuman(zAgent); + }else{ + g.isHuman = 1; + } + g.isMobile = isMobile(zAgent); } /* Set the capabilities */ login_replace_capabilities(zCap, 0); Index: src/main.c ================================================================== --- src/main.c +++ src/main.c @@ -203,10 +203,11 @@ ** SSL client identity */ int useLocalauth; /* No login required if from 127.0.0.1 */ int noPswd; /* Logged in without password (on 127.0.0.1) */ int userUid; /* Integer user id */ int isHuman; /* True if access by a human, not a spider or bot */ + int isMobile; /* Human user on a mobile device w/o a mouse */ int comFmtFlags; /* Zero or more "COMMENT_PRINT_*" bit flags, should be ** accessed through get_comment_format(). */ /* Information used to populate the RCVFROM table */ int rcvid; /* The rcvid. 0 if not yet defined. */ Index: src/style.c ================================================================== --- src/style.c +++ src/style.c @@ -665,11 +665,12 @@ */ static void style_load_all_js_files(void){ int i; if( needHrefJs ){ int nDelay = db_get_int("auto-hyperlink-delay",0); - int bMouseover = db_get_boolean("auto-hyperlink-mouseover",0); + int bMouseover = + !g.isMobile && db_get_boolean("auto-hyperlink-mouseover",0); @ } @