Web/etc.

[OS및 브라우저별 userAgent값]

Calssess 2020. 4. 6. 13:10
반응형

[OS및 브라우저별 userAgent값]

 

Windows XP IE8  (IE7모드로 호환성보기)

           Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0;

 

Windows XP IE8  (IE8 모드로 보기)

           Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0;

 

Windows Vista IE8 (IE7모드로 호환성보기)

           Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0)

 

Windows Vista IE8 (IE8 모드로 보기)

           Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)

 

IE8 on Windows 7 (Window 7 에서 IE8)

           Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)

 

64-bit IE on 64-bit Windows: (64bit 비스타에서 64bit IE8)

           Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Win64; x64; Trident/4.0)

 

32-bit IE on 64-bit Windows: (64bit 비스타에서 32bit IE8)

           Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0)

 

IE11 on Windows 7

   Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko

 

IE11 on 64-bit Windows 8.1 Update

   Mozilla/5.0 (Windows NT 6.3; Win64, x64; Trident/7.0; Touch; rv:11.0) like Gecko

 

IE11 for the desktop on 64-bit Windows 8.1 Update

   Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko

 

IE11 for the desktop on 64-bit Windows 8.1 Update with enterprise mode enabled

 

  Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Tablet PC 2.0)

 

IE11 for the desktop on 64-bit Windows 8.1 Update with compatibility view enabled

   Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; Trident/7.0; Touch)

 

Microsoft Edge for Windows 10 Insider Preview

   Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko

 

Microsoft Edge for Windows Phone

   Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; DEVICE INFO) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Mobile Safari/537.36 Edge/12.0

 

Internet Explorer for Windows Phone 8.1 Update

   Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 520) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537

 

IE11 on a Lumia 928 running Windows Phone 8.1, mobile version

 

   Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11;

 

 IEMobile/11.0; NOKIA; Lumia 928) like Gecko

   IE on a Lumia 920 running Windows Phone 8.0, mobile version

 

Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; 

 

   IEMobile/10.0; ARM; Touch; rv:11; NOKIA; Lumia 920) like Gecko

 

IE on a Lumia 920 running Windows Phone 8.0, desktop version

   Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0; ARM; Touch; WPDesktop)

 

IE on Xbox One

   Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0; Xbox; Xbox One)

 

IE on Xbox 360

   Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; Xbox)

 

[자바스크립트]

<script>

var agent = navigator.userAgent.toLowerCase(); //현재 브라우저 정보를 소문자로 받아온다.

if(agent.indexOf("windows nt 5.1") >= 0) // OS 식별

alert("Windows XP");

else if(agent.indexOf("windows nt 6.0") >=0)

alert("Windows Vista");

else if(agent.indexOf("windows nt 6.1") >= 0)

alert("Windows 7");

else if(agent.indexOf("windows nt 6.3") >= 0) // windows 10

alert("windows 10");

else if(agent.indexOf("windows phone 8.1") >= 0)

alert("Windows Phone 8.1");

else if(agent.indexOf("windows PHONE 10.0") >= 0)

alert("Windows Phone 10.0");

else if(agent.indexOf("android") >= 0 )

alert("Android");

else if(agent.indexOf("iphone") >= 0 )

alert("IPhone");

else if(agent.indexOf("ipad") >= 0 )

alert("IPad");

else if(agent.indexOf("ipod") >= 0 )

alert("IPod");

else if(agent.indexOf("mac") >= 0 )

alert("mac");

else

alert(agent);

 

if(agent.indexOf("msie 7") >= 0) // 브라우저 식별

alert("IE 7");

else if(agent.indexOf("msie 8") >= 0)

alert("IE 8");

else if(agent.indexOf("msie 9") >= 0)

alert("IE 9");

else if(agent.indexOf("msie 10") >= 0) // IE 10

if(agent.indexOf("Touch") >= 0) // IE10 on a machine with touch-capable hardware

alert("IE 10 on Touch");

else

alert("IE 10");

else if(agent.indexOf("rv:11.0") >= 0)

alert("IE 11");

else if(agent.indexOf("edge/12.0") >= 0)

alert("Spartan");

else if(agent.indexOf("chrome") >= 0)

alert("Chrome");

else if(agent.indexOf("safari") >= 0)

alert("Safari");

else if(agent.indexOf("firefox") >= 0)

alert("Firefox");

else if(agent.indexOf("opera") >= 0)

alert("Opera");

else

alert(agent);

 

if(agent.indexOf("win64") >= 0) // 처리방식 식별

alert("64bit")

else if(agent.indexOf("wow64") >= 0)

alert("32-bit IE on 64-bit");

else if(agent.indexOf("arm") >= 0)

alert("Windows RT");

else

alert("32bit");

 

</script>

 

출처 : http://soke.tistory.com/3

반응형