Added Android OS detection from useragent

git-svn-id: https://beef.googlecode.com/svn/trunk@1254 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
bcoles@gmail.com
2011-09-02 11:35:20 +00:00
parent 203173b621
commit ca4e2d18f5
4 changed files with 12 additions and 0 deletions

View File

@@ -85,6 +85,10 @@ beef.os = {
return (this.ua.match('(Maemo Browser)|(Symbian)|(Nokia)')) ? true : false;
},
isAndroid: function() {
return (this.ua.indexOf('Android')) ? true : false;
},
isBlackBerry: function() {
return (this.ua.indexOf('BlackBerry')) ? true : false;
},
@@ -124,6 +128,9 @@ beef.os = {
// BlackBerry
if(this.isBlackBerry()) return 'BlackBerry OS';
// Android
if(this.isAndroid()) return 'Android';
//linux
if(this.isLinux()) return 'Linux';
if(this.isSunOS()) return 'Sun OS';