forked from kaimallea/isMobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
isMobile.min.js
1 lines (1 loc) · 1.65 KB
/
isMobile.min.js
1
!function(a){var b=/iPhone/i,c=/iPod/i,d=/iPad/i,e=/(?=.*\bAndroid\b)(?=.*\bMobile\b)/i,f=/Android/i,g=/(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i,h=/(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i,i=/IEMobile/i,j=/(?=.*\bWindows\b)(?=.*\bARM\b)/i,k=/BlackBerry/i,l=/BB10/i,m=/Opera Mini/i,n=/(?=.*\bFirefox\b)(?=.*\bMobile\b)/i,o=new RegExp("(?:Nexus 7|BNTV250|Kindle Fire|Silk|GT-P1000)","i"),p=function(a,b){return a.test(b)},q=function(a){var q=a||navigator.userAgent,r=q.split("[FBAN");return"undefined"!=typeof r[1]&&(q=r[0]),this.apple={phone:p(b,q),ipod:p(c,q),tablet:!p(b,q)&&p(d,q),device:p(b,q)||p(c,q)||p(d,q)},this.amazon={phone:p(g,q),tablet:!p(g,q)&&p(h,q),device:p(g,q)||p(h,q)},this.android={phone:p(g,q)||p(e,q),tablet:!p(g,q)&&!p(e,q)&&(p(h,q)||p(f,q)),device:p(g,q)||p(h,q)||p(e,q)||p(f,q)},this.windows={phone:p(i,q),tablet:p(j,q),device:p(i,q)||p(j,q)},this.other={blackberry:p(k,q),blackberry10:p(l,q),opera:p(m,q),firefox:p(n,q),device:p(k,q)||p(l,q)||p(m,q)||p(n,q)},this.seven_inch=p(o,q),this.any=this.apple.device||this.android.device||this.windows.device||this.other.device||this.seven_inch,this.phone=this.apple.phone||this.android.phone||this.windows.phone,this.tablet=this.apple.tablet||this.android.tablet||this.windows.tablet,"undefined"==typeof window?this:void 0},r=function(){var a=new q;return a.Class=q,a};"undefined"!=typeof module&&module.exports&&"undefined"==typeof window?module.exports=q:"undefined"!=typeof module&&module.exports&&"undefined"!=typeof window?module.exports=r():"function"==typeof define&&define.amd?define("isMobile",[],a.isMobile=r()):a.isMobile=r()}(this);