- export function isPadDevice() {
- const userAgent = navigator.userAgent || navigator.vendor || window.opera;
- const platform = navigator.platform || '';
- const maxTouchPoints = navigator.maxTouchPoints || 0;
-
- // 检查是否是iPad
- if (/MacIntel/.test(platform) && maxTouchPoints > 1) {
- return true; // iOS 13+ iPad
- }
-
- // 使用正则表达式匹配用户代理字符串以确定是否为移动设备
- return /iPad|Tablet|Android|Mobile|iPod|iPhone/i.test(userAgent);
- }
-
-
|