feat: add ipados to list of Platform.OS (#8205)

* feat: add ipados list of Platform.OS
This commit is contained in:
Marc Seitz 2021-02-04 17:34:44 +02:00 committed by GitHub
parent 210c4857fd
commit 16d88a288f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1,11 +1,11 @@
/* @flow */
const { userAgent } = navigator;
const { userAgent, maxTouchPoints, platform } = navigator;
let OS;
if (userAgent.match(/Android/i)) {
OS = 'android';
} else if (userAgent.match(/iP(ad|hone|od)/i)) {
} else if (userAgent.match(/iP(ad|hone|od)/i) || (maxTouchPoints && maxTouchPoints > 2 && /MacIntel/.test(platform))) {
OS = 'ios';
} else if (userAgent.match(/Mac(intosh| OS X)/i)) {
OS = 'macos';