Skip to content

Commit

Permalink
Merge a31bfb1 into f094114
Browse files Browse the repository at this point in the history
  • Loading branch information
daniol committed Sep 30, 2020
2 parents f094114 + a31bfb1 commit 97f92c6
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/parser-platforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,22 @@ export default [
},
},

/* Nokia */
{
test: [/Nokia/i],
describe(ua) {
const model = Utils.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i, ua);
const platform = {
type: PLATFORMS_MAP.mobile,
vendor: 'Nokia',
};
if (model) {
platform.model = model;
}
return platform;
},
},

/* Mobile */
{
test: [/[^-]mobi/i],
Expand Down
1 change: 1 addition & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export default class Utils {
if (v[0] === 7) return 'Nougat';
if (v[0] === 8) return 'Oreo';
if (v[0] === 9) return 'Pie';
if (v[0] === 10) return 'Q';
return undefined;
}

Expand Down
33 changes: 33 additions & 0 deletions test/acceptance/useragentstrings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,36 @@
type: "tv"
engine:
name: "Blink"
-
ua: "Mozilla/5.0 (Linux; Android 9; Nokia 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Mobile Safari/537.36"
spec:
browser:
name: "Chrome"
version: "85.0.4183.127"
os:
name: "Android"
version: "9"
versionName: "Pie"
platform:
type: "mobile"
vendor: "Nokia"
model: "5.1"
engine:
name: "Blink"
-
ua: "Mozilla/5.0 (Linux; Android 10; SM-G970F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3396.81 Mobile Safari/537.36"
spec:
browser:
name: "Chrome"
version: "75.0.3396.81"
os:
name: "Android"
version: "10"
versionName: "Q"
platform:
type: "mobile"
engine:
name: "Blink"
Google Search:
-
ua: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/83.0.268992909 Mobile/15E148 Safari/605.1"
Expand Down Expand Up @@ -1391,6 +1421,7 @@
version: "8.0"
platform:
type: "mobile"
vendor: "Nokia"
engine:
name: "Trident"
version: "6.0"
Expand All @@ -1405,6 +1436,7 @@
version: "8.0"
platform:
type: "mobile"
vendor: "Nokia"
engine:
name: "Trident"
version: "6.0"
Expand Down Expand Up @@ -1433,6 +1465,7 @@
version: "7.0"
platform:
type: "mobile"
vendor: "Nokia"
engine:
name: "Trident"
version: "3.1"
Expand Down

0 comments on commit 97f92c6

Please sign in to comment.