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

+5 -3
View File
@@ -1,14 +1,16 @@
import { isMobile, userAgent } from './utils/compatibility';
export default class Whitelist {
constructor(art) {
const {
constructor: { kindOf },
option: { whitelist },
} = art;
this.ua = navigator.userAgent;
this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.ua);
this.ua = userAgent;
this.isMobile = isMobile();
this.state =
!this.isMobile ||
whitelist.some(item => {
whitelist.some((item) => {
switch (kindOf(item)) {
case 'string':
return this.ua.indexOf(item) > -1;