Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Commit

Permalink
This commit fixes a small bug identifying mobile Firefox browsers run…
Browse files Browse the repository at this point in the history
…ning on

Android OS versions that report their version number inline.
  • Loading branch information
trentonstrong committed Jun 8, 2018
1 parent 5243daa commit 9d00ff9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ var uastrings = []struct {
ua: "Mozilla/5.0 (Android; Mobile; rv:17.0) Gecko/17.0 Firefox/17.0",
expected: "Mozilla:5.0 Platform:Mobile OS:Android Browser:Firefox-17.0 Engine:Gecko-17.0 Bot:false Mobile:true",
},
{
title: "AndroidFirefoxNougat",
ua: "Mozilla/5.0 (Android 7.0; Mobile; rv:60.0) Gecko/60.0 Firefox/60.0",
expected: "Mozilla:5.0 Platform:Mobile OS:Android 7.0 Browser:Firefox-60.0 Engine:Gecko-60.0 Bot:false Mobile:true",
},
{
title: "AndroidFirefoxTablet",
ua: "Mozilla/5.0 (Android; Tablet; rv:26.0) Gecko/26.0 Firefox/26.0",
Expand Down
2 changes: 1 addition & 1 deletion operating_systems.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func gecko(p *UserAgent, comment []string) {
p.os = normalizeOS(comment[1])
}
} else {
if p.platform == "Android" {
if strings.Contains(p.platform, "Android") {
p.mobile = true
p.platform, p.os = normalizeOS(comment[1]), p.platform
} else if comment[0] == "Mobile" || comment[0] == "Tablet" {
Expand Down

0 comments on commit 9d00ff9

Please sign in to comment.