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

Commit 9d00ff9

Browse files
committed
This commit fixes a small bug identifying mobile Firefox browsers running on
Android OS versions that report their version number inline.
1 parent 5243daa commit 9d00ff9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

all_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ var uastrings = []struct {
228228
ua: "Mozilla/5.0 (Android; Mobile; rv:17.0) Gecko/17.0 Firefox/17.0",
229229
expected: "Mozilla:5.0 Platform:Mobile OS:Android Browser:Firefox-17.0 Engine:Gecko-17.0 Bot:false Mobile:true",
230230
},
231+
{
232+
title: "AndroidFirefoxNougat",
233+
ua: "Mozilla/5.0 (Android 7.0; Mobile; rv:60.0) Gecko/60.0 Firefox/60.0",
234+
expected: "Mozilla:5.0 Platform:Mobile OS:Android 7.0 Browser:Firefox-60.0 Engine:Gecko-60.0 Bot:false Mobile:true",
235+
},
231236
{
232237
title: "AndroidFirefoxTablet",
233238
ua: "Mozilla/5.0 (Android; Tablet; rv:26.0) Gecko/26.0 Firefox/26.0",

operating_systems.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func gecko(p *UserAgent, comment []string) {
129129
p.os = normalizeOS(comment[1])
130130
}
131131
} else {
132-
if p.platform == "Android" {
132+
if strings.Contains(p.platform, "Android") {
133133
p.mobile = true
134134
p.platform, p.os = normalizeOS(comment[1]), p.platform
135135
} else if comment[0] == "Mobile" || comment[0] == "Tablet" {

0 commit comments

Comments
 (0)