티스토리 뷰
request 객체를 통해 브라우져의 User Agent 확인한다.
request.getHeader("User-Agent");
클라이언트단에서 모바일이나 태블릿에서 접근 확인
function isMobile() { if(navigator.userAgent.indexOf("Android") > -1 || navigator.userAgent.indexOf("iPhone") > -1 || navigator.userAgent.indexOf("iPad") > -1) { return true; } else { return false; } }
서버단에서 모바일이나 태블릿에서 접근 막기
String userAgent = request.getHeader("user-agent"); if(userAgent.indexOf("Android") > -1 || userAgent.indexOf("iPhone") > -1 || userAgent.indexOf("iPad") > -1) { ........중략........... }
MS IE9
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
MS IE10
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; [platform token] Trident/6.0; Touch)
Chrome 버전 23.0.1271.64 m
Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11
Firefox 버전 16.0.2
Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20100101 Firefox/16.0
갤럭시S
Mozilla/5.0 (Linux; U; Android 2.3.6; ko-kr; SHW-M110S Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
LG Optimus LTE
Mozilla/5.0 (Linux; U; Android 4.0.4; ko-kr; LG-LU6200 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
아이폰4S
Mozilla/5.0 (iPhone; CPU iPhone OS 6_0_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A523 Safari/8536.25
iPad
Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405
자료 찾다가 시장 점유율을 봤는데 크롬의 상승세가 대단하네요..
웹브라우져 시장 점유율
(출처 : http://en.wikipedia.org/wiki/HTTP_user_agent)
참고
http://blog.outsider.ne.kr/449
http://en.wikipedia.org/wiki/Special:Search/List_of_user_agents_for_mobile_phones
http://en.wikipedia.org/wiki/Internet_Explorer_10#User_agent_string
http://www.useragentstring.com