Post

디바이스 감지 Detect Devices

Ipad

1
2
(navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) ||
  navigator.platform === "iPad";

mobile

1
2
3
4
5
6
7
8
9
10
11
12
13
const toMatch = [
  /Android/i,
  /webOS/i,
  /iPhone/i,
  /iPad/i,
  /iPod/i,
  /BlackBerry/i,
  /Windows Phone/i,
];

return toMatch.some((toMatchItem) => {
  return navigator.userAgent.match(toMatchItem);
});

How to detect iPad Pro as iPad using javascript?

This post is licensed under CC BY 4.0 by the author.