SoFunction
Updated on 2025-03-01

JS is a simple way to determine whether a mobile device logs into a web page


var browser = {
            versions: function () {
                var u = , app = ;
Return {//Mobile terminal browser version information
trident: ('Trident') > -1, //IE kernel
presto: ('Presto') > -1, //opera kernel
webKit: ('AppleWebKit') > -1, //Apple, Google Kernel
gecko: ('Gecko') > -1 && ('KHTML') == -1, //Firefox kernel
mobile: !!(/AppleWebKit.*Mobile.*/) || !!(/AppleWebKit/), //Is it a mobile terminal
ios: !!(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios terminal
android: ('Android') > -1 || ('Linux') > -1, //android terminal or uc browser
iPhone: ('iPhone') > -1 || ('Mac') > -1, //Is it an iPhone or QQHD browser
iPad: ('iPad') > -1, //Is it iPad or not
webApp: ('Safari') == -1 //Whether the web should be a program, no header or bottom
                };
            } (),
            language: ( || ).toLowerCase()
        }
if ( == true || == true || == true) {
            = target;
        }