From 5af24a6cf70074c5d9227cf92c14ab793a478ac1 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Sat, 15 Apr 2023 01:08:46 +0700 Subject: [PATCH] Fix #643 - Improve iOS detection (cherry picked from commit 29fb85658adb66e4b842ffe721b38e77f4ec5cd1) --- src/ua-parser.js | 2 +- test/os-test.json | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index 847fa9623..b5299867a 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -721,7 +721,7 @@ // iOS/macOS /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS - /ios;fbsv\/([\d\.]+)/i, + /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i, /cfnetwork\/.+darwin/i ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [ /(mac os x) ?([\w\. ]*)/i, diff --git a/test/os-test.json b/test/os-test.json index 7e1e157c8..79aed3f2e 100644 --- a/test/os-test.json +++ b/test/os-test.json @@ -773,6 +773,15 @@ "version" : "13.6.1" } }, + { + "desc": "iOS with Slack App", + "ua": "com.tinyspeck.chatlyio/23.04.10 (iPhone; iOS 16.4.1; Scale/3.00)", + "expect": + { + "name" : "iOS", + "version" : "16.4.1" + } + }, { "desc" : "watchOS", "ua" : "server-bag [Watch OS,8.4,19S546,Watch3,4]",