Skip to content

Commit

Permalink
Detect embedded webview on iPadOS. (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
bclark-videra authored Oct 21, 2023
1 parent 60a204d commit df36b1c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
[
Expand Down Expand Up @@ -188,7 +190,6 @@ export function detectDevice(): BuiltinHandlerName | undefined
else if (
engineName === 'webkit' &&
isIOS &&
osVersion >= 14.3 &&
typeof RTCRtpTransceiver !== 'undefined' &&
RTCRtpTransceiver.prototype.hasOwnProperty('currentDirection'))
{
Expand Down

0 comments on commit df36b1c

Please sign in to comment.