Skip to content

Instantly share code, notes, and snippets.

Created October 28, 2013 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7199832 to your computer and use it in GitHub Desktop.
Save anonymous/7199832 to your computer and use it in GitHub Desktop.
ui.mobile.detect.Frame.prototype.isMobile = function (b) {
var a = {
Android: function () {
return b.match(/Android/i) ? true : false
},
BlackBerry: function () {
return b.match(/BlackBerry/i) ? true : false
},
iOS: function () {
if (b.match(/iPad/i)) {
return false
}
return b.match(/iPhone|iPod/i) ? true : false
},
mobile: function(){
return b.match(/mobi/i) ? true : false
},
Windows: function () {
return b.match(/IEMobile/i) ? true : false
}
};
return (a.Android() || a.BlackBerry() || a.iOS() || a.Windows() || is.mobile())
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment