Skip to content

Commit

Permalink
Merge pull request #830 from miketaylr/no-android-version
Browse files Browse the repository at this point in the history
Fixes #647: Update android regex to match Firefox for Android.
  • Loading branch information
madrobby committed Oct 9, 2013
2 parents eb35bc5 + d21ce64 commit 5a59c50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/detect.js
Expand Up @@ -6,7 +6,7 @@
function detect(ua){
var os = this.os = {}, browser = this.browser = {},
webkit = ua.match(/WebKit\/([\d.]+)/),
android = ua.match(/(Android)\s+([\d.]+)/),
android = ua.match(/(Android);?\s+([\d.]+)?/),
ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/),
iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/),
Expand Down
2 changes: 2 additions & 0 deletions test/detect.html
Expand Up @@ -337,13 +337,15 @@ <h1>Browser detection</h1>
detect(UA.Firefox_13_Tablet, function(os, browser){
t.assertTrue(browser.firefox)
t.assertFalse(browser.webkit)
t.assertTrue(os.android)
t.assertFalse(os.phone)
t.assertTrue(os.tablet)
})

detect(UA.Firefox_13_Phone, function(os, browser){
t.assertTrue(browser.firefox)
t.assertFalse(browser.webkit)
t.assertTrue(os.android)
t.assertTrue(os.phone)
t.assertFalse(os.tablet)
})
Expand Down

0 comments on commit 5a59c50

Please sign in to comment.