From df36b1c25e113f1cd00466ee6b3017d8fe41c6b9 Mon Sep 17 00:00:00 2001 From: Byron Clark Date: Sat, 21 Oct 2023 05:32:18 -0600 Subject: [PATCH] Detect embedded webview on iPadOS. (#280) --- src/Device.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Device.ts b/src/Device.ts index d6d475ce..1554b60a 100644 --- a/src/Device.ts +++ b/src/Device.ts @@ -103,8 +103,10 @@ export function detectDevice(): BuiltinHandlerName | undefined const os = uaParser.getOS(); const osName = os.name?.toLowerCase() ?? ''; const osVersion = parseFloat(os.version ?? '0'); + const device = uaParser.getDevice(); + const deviceModel = device.model?.toLowerCase() ?? ''; - const isIOS = osName === 'ios'; + const isIOS = osName === 'ios' || deviceModel === 'ipad'; const isChrome = [ @@ -188,7 +190,6 @@ export function detectDevice(): BuiltinHandlerName | undefined else if ( engineName === 'webkit' && isIOS && - osVersion >= 14.3 && typeof RTCRtpTransceiver !== 'undefined' && RTCRtpTransceiver.prototype.hasOwnProperty('currentDirection')) {