Permalink
Browse files

Merge pull request #830 from miketaylr/no-android-version

Fixes #647: Update android regex to match Firefox for Android.
  • Loading branch information...
madrobby committed Oct 9, 2013
2 parents eb35bc5 + d21ce64 commit 5a59c50e93ed47b9eec6739a208fbff08d998959
Showing with 3 additions and 1 deletion.
  1. +1 −1 src/detect.js
  2. +2 −0 test/detect.html
@@ -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_]+)/),
@@ -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)
})

0 comments on commit 5a59c50

Please sign in to comment.