Reference: http://www.cnblogs.com/phphuaibei/archive/2011/12/09/2282570.html
Var browser = {versions: function () {var u = navigator. userAgent, app = navigator. appVersion; return {trident: u. indexOf ('think')>-1, // IE kernel presto: u. indexOf ('presto ')>-1, // opera kernel webKit: u. indexOf ('applewebkit ')>-1, // Apple, Google kernel gecko: u. indexOf ('gecko ')>-1 & u. indexOf ('khtml ') =-1, // Firefox kernel mobile :!! U. match (/AppleWebKit. * Mobile. */) | !! U. match (/AppleWebKit/), // whether it is a mobile device ios :!! U. match (/\ (I [^;] +; (U ;)? CPU. + Mac OS X/), // ios terminal android: u. indexOf ('android')>-1 | u. indexOf ('linux ')>-1, // android terminal or uc browser iPhone: u. indexOf ('iphone ')>-1 | u. indexOf ('mac')>-1, // whether the browser is iPhone or QQHD iPad: u. indexOf ('ipad ')>-1, // whether iPadwebApp: u. indexOf ('safari ') =-1, // whether the web should program, no header with the bottom linux: u. indexOf ('linux ')>-1, // Add mobile with this attribute to determine the uc browser wp7: (u. indexOf ('wp7 ')>-1) | (u. indexOf ('windows Phone OS ')>-1) // trident IE kernel and contains WP7 mark Windows phone7 mobile Phone };}(), language: (navigator. browserLanguage | navigator. language ). toLowerCase ()}; document. write ("language:" + browser. language + '</br>'); document. write ("android:" + (browser. versions. mobile & browser. versions. android) + '</br>'); document. write ("iPhone:" + (browser. versions. mobile & browser. versions. iPhone) + '</br>'); document. write ("iPad:" + (browser. versions. mobile & browser. versions. iPad) + '</br>'); document. write ("Wp7:" + (browser. versions. trident & browser. versions. wp7) + '</br>'); document. write (navigator. userAgent );
1. Many third-party browsers, such as Baidu, QQ, and UC, are amazing. I tested the value of the UC browser on windows phone 7 for different models. The UserAgent varies greatly.
2. On the other hand, you can set the browser mode in windows phone 7 settings. There are two modes, Desktop and Mobile. These two modes have different useragents. Pay special attention to them.