Skip to content

Instantly share code, notes, and snippets.

Created Oct 28, 2013
Embed
What would you like to do?
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