Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect embedded webview on iPadOS. #280

Merged
merged 2 commits into from
Oct 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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' || (osName === 'mac os' && deviceModel === 'ipad');
bclark-videra marked this conversation as resolved.
Show resolved Hide resolved

const isChrome =
[
Expand Down Expand Up @@ -188,7 +190,6 @@ export function detectDevice(): BuiltinHandlerName | undefined
else if (
engineName === 'webkit' &&
isIOS &&
osVersion >= 14.3 &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this is not super required, but what is wrong with it? Is this version requirement generating some issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, iPadOS WKWebView reports as OS Version 10.15.

typeof RTCRtpTransceiver !== 'undefined' &&
RTCRtpTransceiver.prototype.hasOwnProperty('currentDirection'))
{
Expand Down