Skip to content

Commit

Permalink
Fix #605 - Identify Macintosh as Apple device
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Dec 6, 2022
1 parent b814bcd commit a886604
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@
/applecoremedia\/[\w\.]+ \((ipad)/i,
/\b(ipad)\d\d?,\d\d?[;\]].+ios/i
], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [
/(macintosh);/i
], [MODEL, [VENDOR, APPLE]], [

// Huawei
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
Expand Down
9 changes: 9 additions & 0 deletions test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,15 @@
"type": "mobile"
}
},
{
"desc": "Apple Desktop",
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15",
"expect": {
"vendor": "Apple",
"model": "Macintosh",
"type": "undefined"
}
},
{
"desc": "iPad using UCBrowser",
"ua": "Mozilla/5.0 (iPad; U; CPU OS 11_2 like Mac OS X; zh-CN; iPad5,3) AppleWebKit/534.46 (KHTML, like Gecko) UCBrowser/3.0.1.776 U3/ Mobile/10A403 Safari/7543.48.3",
Expand Down

1 comment on commit a886604

@noneall
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@faisalman when will this get released?

Please sign in to comment.