From 5d603dacd7fc065ee5e47471e180a164961c81fa Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Thu, 12 Dec 2024 07:29:56 +0700 Subject: [PATCH] Add new device: Apple HomePod --- src/main/ua-parser.js | 4 +++- test/data/ua/device/apple.json | 9 +++++++++ test/data/ua/os/ios.json | 9 +++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/ua-parser.js b/src/main/ua-parser.js index 7dbe7dc..0fa08b9 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]], [ + /(homepod).+mac os/i // Apple HomePod + ], [MODEL, [VENDOR, APPLE], [TYPE, EMBEDDED]], [ /windows iot/i ], [[TYPE, EMBEDDED]], [ @@ -898,7 +900,7 @@ ], [[VERSION, strMapper, windowsVersionMap], [NAME, WINDOWS]], [ // iOS/macOS - /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS + /[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i, /cfnetwork\/.+darwin/i ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [ diff --git a/test/data/ua/device/apple.json b/test/data/ua/device/apple.json index 4de5728..ea68e8a 100644 --- a/test/data/ua/device/apple.json +++ b/test/data/ua/device/apple.json @@ -116,6 +116,15 @@ "type": "mobile" } }, + { + "desc": "Apple HomePod", + "ua": "AppleCoreMedia/1.0.0.15D61 (HomePod; U; CPU OS 11_2_5 like Mac OS X; en_us)", + "expect": { + "vendor": "Apple", + "model": "HomePod", + "type": "embedded" + } + }, { "desc": "Issue #519", "ua": "ios/iPhone/14.2/SOME_CUSTOM_APP_VERSION", diff --git a/test/data/ua/os/ios.json b/test/data/ua/os/ios.json index 66cff1e..86ba8cb 100644 --- a/test/data/ua/os/ios.json +++ b/test/data/ua/os/ios.json @@ -52,5 +52,14 @@ "name" : "iOS", "version" : "7.0.2" } + }, + { + "desc": "Apple HomePod", + "ua": "AppleCoreMedia/1.0.0.15D61 (HomePod; U; CPU OS 11_2_5 like Mac OS X; en_us)", + "expect" : + { + "name" : "iOS", + "version" : "11.2.5" + } } ] \ No newline at end of file