프론트엔드
userAgent 정리
카엔입니다
2022. 8. 11. 23:30
Detecting a mobile browser
I'm looking for a function which return boolean value if user has mobile browser or not. I know that I can use navigator.userAgent and write that function by using regex, but user-agents are too v...
stackoverflow.com
흔히 사용하는 기기들만 걸러주는 정규식
if (
/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ||
/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.platform)
) {
// mobile only code
console.log("mobile로 접속중");
}
[JS] 📚 웹페이지에 접속하는 기기(모바일/태블릿/PC) 구분하기
[JS] 📚 웹페이지에 접속하는 기기(모바일/태블릿/PC) 구분하기
웹페이지 접속 기기 종류 체크 (Detecting a mobile browser) 요즘은 반응형 웹이 기본인 시대라, css의 @media screen을 통해 PC와 모바일 화면을 다르게 설정 한다. 하지만 독자적인 모바일 기기용 UI를 구현
inpa.tistory.com