varBrower ={versions:function(){ varU =window.navigator.userAgent; varnum; if(U.indexof (' Trident ') >-1){ //IE return"IE"; }Else if(U.indexof (' Presto ') >-1){ //Opera return"Opera"; }Else if(U.indexof (' Gecko ') >-1 && u.indexof (' khtml ') = =-1){ //Firefox return"Firefox"; }Else if(U.indexof (' AppleWebKit ' && u.indexof (' Safari ') >-1) > 1){ //Apple, Google kernel if(U.indexof (' Chrome ') >-1){ //Chrome return"Chrome"; }Else if(U.indexof (' OPR ')){ //WebKit Opera return"Opera_webkit" }Else{ //Safari return"Safari"; } }Else if(U.indexof (' Mobile ') >-1){ //Mobile Side if(!! U.match (/\ (i[^;] +;( U;)? Cpu.+mac OS x/)){ //iOS if(U.indexof (' IPhone ') >-1){ //iphone return"IPhone" }Else if(U.indexof (' IPod ') >-1){ //ipod return"IPod" }Else if(U.indexof (' IPad ') >-1){ //ipad return"IPad" } }Else if(U.indexof (' Android ') >-1 | | u.indexof (' Linux ') >-1){ //Androidnum = U.substr (u.indexof (' Android ') + 8, 3); return{"type": "Android", "version": num}; }Else if(U.indexof (' BB10 ') >-1 ){ //BlackBerry BB10 System return"BB10"; }Else if(U.indexof (' Iemobile ')){ //Windows Phone return"Windows Phone" } } } }
Brower.versions ()