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

Commit

Permalink
Merge pull request #43 from trentonstrong/fix-android-nougat-firefox
Browse files Browse the repository at this point in the history
Fix mobile Firefox on Android Nougat
  • Loading branch information
mssola authored Jun 8, 2018
2 parents 5243daa + 9d00ff9 commit d7bd3b0
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 d7bd3b0

Please sign in to comment.