Skip to content

Commit 4c935c0

Browse files
committed
Improve device detection: Nokia
1 parent ae7b5e1 commit 4c935c0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/ua-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@
658658
/(nokia) (t[12][01])/i
659659
], [VENDOR, MODEL, [TYPE, TABLET]], [
660660
/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,
661-
/nokia[-_ ]?(([-\w\. ]*))/i
661+
/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i
662662
], [[MODEL, /_/g, ' '], [TYPE, MOBILE], [VENDOR, 'Nokia']], [
663663

664664
// Google

test/data/ua/device/nokia.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
[
2+
{
3+
"desc": "Nokia 1",
4+
"ua": "Mozilla/5.0 (Linux; Android 10; Nokia 1 Build/QP1A.190711.020) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.5304.15 Mobile Safari/537.36",
5+
"expect": {
6+
"vendor": "Nokia",
7+
"model": "1",
8+
"type": "mobile"
9+
}
10+
},
211
{
312
"desc": "Nokia3xx",
413
"ua": "Nokia303/14.87 CLDC-1.1",

0 commit comments

Comments
 (0)