add isSafari util

This commit is contained in:
Harvey committed 2020-04-10 18:31:27 +08:00
1 parent 5f5461eeb4
commit be060e48c4
9 files changed
+37 -14

No files matched your search

@@ -0,0 +1,9 @@
export const userAgent = window.navigator.userAgent;
export function isMobile() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent);
}
export function isSafari() {
return /^((?!chrome|android).)*safari/i.test(userAgent);
}
+1
View File
@@ -5,3 +5,4 @@ export * from './file';
export * from './property';
export * from './time';
export * from './format';
export * from './compatibility';