From f715023f476f3026ef2fabbb2250e1df1d6ac0e3 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Mon, 12 Apr 2021 12:24:34 +0700 Subject: [PATCH] Improve device detection: categorize PDA as mobile --- src/ua-parser.js | 2 +- test/device-test.json | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index 0885ab2..cfc0861 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -659,7 +659,7 @@ ], [MODEL, [TYPE, TABLET]], [ /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i, // Unidentifiable Tablet ], [[TYPE, TABLET]], [ - /(phone|mobile(?:[;\/]| safari))/i // Unidentifiable Mobile + /(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i // Unidentifiable Mobile ], [[TYPE, MOBILE]], [ /(android[\w\.\s\-]{0,9});.+buil/i // Generic Android Device ], [MODEL, [VENDOR, 'Generic']] diff --git a/test/device-test.json b/test/device-test.json index 41da99f..eab9070 100644 --- a/test/device-test.json +++ b/test/device-test.json @@ -2514,5 +2514,14 @@ "model": "undefined", "type": "smarttv" } + }, + { + "desc": "PDA with Windows CE", + "ua": "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "mobile" + } } ]