Skip to content

Commit

Permalink
Fix #643 - Improve iOS detection (cherry picked from commit 29fb856)
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Sep 9, 2023
1 parent d810feb commit 5af24a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions test/os-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand Down

0 comments on commit 5af24a6

Please sign in to comment.