일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- context
- React 18 Nextjs
- background: url
- React 고급안내서
- Babel
- hook
- React 공식문서
- React 18
- Javascript
- React API 참고서
- react hook
- react-helmet
- background setttimeout
- RTK Query
- Next13
- react
- Nextjs React 18
- CSS
- background setInterval
- Render Props
- getUTCDate
- Programmers
- React 고급 안내서
- 고급안내서
- notFound()
- background tab
- next13 head
- Nextjs
- codingtest
- React18
Archives
- Today
- Total
akjfal
12/12 본문
https://zinee-world.tistory.com/512
[JS] User Agent 브라우저 정보 얻기 (크롬인지 아닌지 체크하기)
< 좌. MacOS / 우. Windows > 크롬 다운로드를 권장하기 위해서 띠배너를 보여주는데, 크롬 브라우저일 경우에는 보이지 않아야 한다. 어떻게 하면 크롬 브라우저 인지 알 수 있을까? userAgent를 통해 확인 할..
zinee-world.tistory.com
useEffect(()=>{
const is_safari_or_uiwebview = /(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);
const is_uiwebview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent);
const {standalone} = navigator;
const userAgent = window.navigator.userAgent.toLowerCase();
const safari = /safari/.test( userAgent );
const ios = /iphone|ipod|ipad/.test( userAgent );
console.log(userAgent)
console.log(window.navigator.userAgent.toLowerCase())
if( ios ) {
setInAppAlert(true)
} else {
// not iOS
};
}, [])
짧지만 많은 것들을 공부하게해준 코드다.
mozilla/5.0 (ipad; cpu os 11_0 like mac os x) applewebkit/604.1.34 (khtml, like gecko) version/11.0 mobile/15a5341f safari/604.1
agent찍어본거다
그리고 인스타는 자기가 인스타라고 알려주는데 트위터는 노답...사파리랑 같다
'하루의 이슈' 카테고리의 다른 글
1/7 (0) | 2020.01.07 |
---|---|
12/24 - 이브날에 터진 axios -Failed to load resource: the server responded with a status of 429 () (0) | 2019.12.24 |
주간 이슈 (0) | 2019.12.02 |
주간 이슈(2주치) (0) | 2019.11.23 |
11/21 (0) | 2019.11.22 |
Comments