Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 노드교과서
- 자바스크립트#조건문#문자열
- 헷갈린다~
- 자바스크립트#JS#slice#splice
- redux상태유지
- children vs childrenNodes
- removeCookie
- slice/splice/split
- https://lo-victoria.com/introduction-to-redux-toolkit-for-beginners
- dom
- 자바스크립트
- 내장고차함수
- https://dasima.xyz/%EC%9E%90%EB%B0%94%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8-%EC%A0%9C%EA%B3%B1-math-pow-%EA%B3%84%EC%82%B0/
- toString#String
- https://www.daleseo.com/js-array-slice-splice/
- 자바스크립트#JS#var#let#const#undefined#null
- UX
- JS#3일차달리자#초반인데#시간금방~
- https://developer-talk.tistory.com/299
- ㄷㅌ
- User Flow
- variable#function
- react
- js
- CSS
- UI
- for~in/for~of
- cmarket
- @redux-toolkit
- Beesbeesbees
Archives
- Today
- Total
Daily Front_Minhhk
[React] 로그인 시, 유입종류 브라우저&웹&모바일 로그 남기기 본문
접속한 브라우저 종류 및 웹이냐 모바일에 따라 로그 따로 남길 때
- MOBILE, WEB 은 상수다,,
- export const MOBILE = "mobile"
- export const WEB = "web"
import { MOBILE, WEB } from "@/constants/words";
export const isMobileDevice = (): string => {
const userAgent = navigator.userAgent;
const mobileRegex = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i;
if (mobileRegex.test(userAgent.toLowerCase())) return MOBILE;
return WEB;
};
export const getBrowserName = (): string => {
const userAgent = navigator.userAgent.toLowerCase();
if (userAgent.includes("firefox")) return "Firefox";
if (userAgent.includes("chrome") && !userAgent.includes("edg")) return "Chrome";
if (userAgent.includes("safari") && !userAgent.includes("chrome")) return "Safari";
if (userAgent.includes("edg")) return "Edge";
if (userAgent.includes("msie") || userAgent.includes("trident")) return "Internet Explorer";
if (userAgent.includes("opera") || userAgent.includes("opr")) return "Opera";
return "unknown";
};
'Code개발일지' 카테고리의 다른 글
[meta tag] 카카오톡 링크 공유, 이미지 메타 태그 (1) | 2024.12.08 |
---|---|
[Git] ssh-key 여러개 사용 (0) | 2024.12.08 |
[React] 파일 다운로드 훅_blob filedown hook (1) | 2024.12.08 |
[vercel] react-vite vercel 간단 배포 (0) | 2024.12.08 |
[next.js] react-pdf__적용 (+ zoom in/out) (0) | 2024.05.14 |