diff --git a/src/enums/ua-parser-enums.d.ts b/src/enums/ua-parser-enums.d.ts index efc73207..5c406c39 100644 --- a/src/enums/ua-parser-enums.d.ts +++ b/src/enums/ua-parser-enums.d.ts @@ -356,6 +356,7 @@ export const OS: Readonly<{ WATCHOS: "watchOS"; WEBOS: "WebOS"; WINDOWS: "Windows"; + WINDOWS_IOT: "Windows IoT"; WINDOWS_MOBILE: "Windows Mobile"; WINDOWS_PHONE: "Windows Phone"; XBOX: "Xbox"; diff --git a/src/enums/ua-parser-enums.js b/src/enums/ua-parser-enums.js index 3cd51481..08a7afc7 100644 --- a/src/enums/ua-parser-enums.js +++ b/src/enums/ua-parser-enums.js @@ -371,6 +371,7 @@ const OS = Object.freeze({ WATCHOS: 'watchOS', WEBOS: 'WebOS', WINDOWS: 'Windows', + WINDOWS_IOT: 'Windows IoT', WINDOWS_MOBILE: 'Windows Mobile', WINDOWS_PHONE: 'Windows Phone', XBOX: 'Xbox', diff --git a/src/main/ua-parser.js b/src/main/ua-parser.js index f7f2a646..7dbe7dc2 100755 --- a/src/main/ua-parser.js +++ b/src/main/ua-parser.js @@ -840,6 +840,8 @@ ], [VENDOR, [TYPE, EMBEDDED]], [ /(aeobc)\b/i // Echo Dot ], [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], [ + /windows iot/i + ], [[TYPE, EMBEDDED]], [ //////////////////// // MIXED (GENERIC) @@ -888,10 +890,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/data/ua/device/_others.json b/test/data/ua/device/_others.json index 7ee9ec64..b830065a 100644 --- a/test/data/ua/device/_others.json +++ b/test/data/ua/device/_others.json @@ -246,5 +246,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/data/ua/os/windows.json b/test/data/ua/os/windows.json index 39e95415..7e122822 100644 --- a/test/data/ua/os/windows.json +++ b/test/data/ua/os/windows.json @@ -116,6 +116,15 @@ "version" : "CE" } }, + { + "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" : "Windows NT on x86 or aarch64 CPU using Firefox", "ua" : "Mozilla/5.0 (Windows NT x.y; rv:10.0) Gecko/20100101 Firefox/10.0",