Skip to content

Commit

Permalink
fix issue isiOSDevice device function for IPad
Browse files Browse the repository at this point in the history
  • Loading branch information
ihor.kobylinskyi@eleks.com committed Aug 3, 2021
1 parent 3843233 commit f1692fe
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,20 @@ export class VgUtilsService {

static isiOSDevice() {
return (
navigator.userAgent.match(/ip(hone|ad|od)/i) &&
(navigator.userAgent.match(/ip(hone|ad|od)/i) ||
VgUtilsService.isIpadOS()) &&
!navigator.userAgent.match(/(iemobile)[\/\s]?([\w\.]*)/i)
);
}

static isIpadOS() {
return (
navigator.maxTouchPoints &&
navigator.maxTouchPoints > 2 &&
/MacIntel/.test(navigator.platform)
);
}

static isCordova() {
return (
document.URL.indexOf('http://') === -1 &&
Expand Down

0 comments on commit f1692fe

Please sign in to comment.