Skip to content

Commit

Permalink
feat: add Nokia Vendor (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniol authored Nov 17, 2023
1 parent 0c7380d commit 4481f5a
Show file tree
Hide file tree
Showing 2 changed files with 48 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
32 changes: 32 additions & 0 deletions test/acceptance/useragentstrings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,35 @@
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"
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 +1420,7 @@
version: "8.0"
platform:
type: "mobile"
vendor: "Nokia"
engine:
name: "Trident"
version: "6.0"
Expand All @@ -1405,6 +1435,7 @@
version: "8.0"
platform:
type: "mobile"
vendor: "Nokia"
engine:
name: "Trident"
version: "6.0"
Expand Down Expand Up @@ -1433,6 +1464,7 @@
version: "7.0"
platform:
type: "mobile"
vendor: "Nokia"
engine:
name: "Trident"
version: "3.1"
Expand Down

0 comments on commit 4481f5a

Please sign in to comment.