Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a886604

Browse filesBrowse files
committed
Fix #605 - Identify Macintosh as Apple device
1 parent b814bcd commit a886604
Copy full SHA for a886604

File tree

2 files changed

+11
-0
lines changed
Filter options

2 files changed

+11
-0
lines changed

‎src/ua-parser.js

Copy file name to clipboardExpand all lines: src/ua-parser.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@
390390
/applecoremedia\/[\w\.]+ \((ipad)/i,
391391
/\b(ipad)\d\d?,\d\d?[;\]].+ios/i
392392
], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [
393+
/(macintosh);/i
394+
], [MODEL, [VENDOR, APPLE]], [
393395

394396
// Huawei
395397
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i

‎test/device-test.json

Copy file name to clipboardExpand all lines: test/device-test.json
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,15 @@
754754
"type": "mobile"
755755
}
756756
},
757+
{
758+
"desc": "Apple Desktop",
759+
"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",
760+
"expect": {
761+
"vendor": "Apple",
762+
"model": "Macintosh",
763+
"type": "undefined"
764+
}
765+
},
757766
{
758767
"desc": "iPad using UCBrowser",
759768
"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",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.