From 1d59e1a6ee18b161f8d912fbcb1b3148dba4f9e9 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Thu, 12 Dec 2024 06:29:35 +0700 Subject: [PATCH] Backport - Add new OS: `Windows IoT` (cherry picked from commit 84b41f5be77334d46f76c55ec505acc5383c48c7) --- src/ua-parser.js | 8 +++++--- test/device-test.json | 9 +++++++++ test/os-test.json | 9 +++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index bd7ec39..00926bf 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -769,6 +769,8 @@ ], [VENDOR, [TYPE, EMBEDDED]], [ /(aeobc)\b/i // Echo Dot ], [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], [ + /windows iot/i + ], [[TYPE, EMBEDDED]], [ //////////////////// // MIXED (GENERIC) @@ -814,10 +816,10 @@ // Windows /microsoft (windows) (vista|xp)/i // Windows (iTunes) ], [NAME, VERSION], [ - /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i // Windows Phone + /(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i // Windows Phone ], [NAME, [VERSION, strMapper, windowsVersionMap]], [ - /windows nt 6\.2; (arm)/i, // Windows RT - /windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i, + /windows nt 6\.2; (arm)/i, // Windows RT + /windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i, /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i ], [[VERSION, strMapper, windowsVersionMap], [NAME, 'Windows']], [ diff --git a/test/device-test.json b/test/device-test.json index e56a555..a17ec75 100644 --- a/test/device-test.json +++ b/test/device-test.json @@ -6636,5 +6636,14 @@ "model": "undefined", "type": "mobile" } + }, + { + "desc" : "Windows IoT", + "ua" : "Mozilla/5.0 (Windows IoT 10.0; Android 6.0.1; WebView/3.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Mobile Safari/537.36 Edge/18.17763", + "expect": { + "vendor": "undefined", + "model": "undefined", + "type": "embedded" + } } ] \ No newline at end of file diff --git a/test/os-test.json b/test/os-test.json index 91efe14..0240914 100644 --- a/test/os-test.json +++ b/test/os-test.json @@ -80,6 +80,15 @@ "version" : "10" } }, + { + "desc" : "Windows IoT", + "ua" : "Mozilla/5.0 (Windows IoT 10.0; Android 6.0.1; WebView/3.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Mobile Safari/537.36 Edge/18.17763", + "expect" : + { + "name" : "Windows IoT", + "version" : "10.0" + } + }, { "desc" : "WeChat Desktop for Windows Built-in Browser", "ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 MicroMessenger/6.5.2.501 NetType/WIFI WindowsWechat QBCore/3.43.901.400 QQBrowser/9.0.2524.400",