Skip to content

add WeChat inline browser support on iOS whith version >=14.3 #201

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

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from
Open
Changes from all commits
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
4 changes: 4 additions & 0 deletions src/Device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ export function detectDevice(): BuiltinHandlerName | undefined
{
return 'Safari12';
}
// WeChat inline browser on iOS.
else if (browser.satisfies({ ios: { OS: '>=14.3', wechat: '>=0' } })) {
Copy link
Member

@ibc ibc Feb 25, 2022

Choose a reason for hiding this comment

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

Why not just ios OS: iOS WeChat >= 14.3? Why should we need to deal with every app safari based browser?

Copy link
Author

Choose a reason for hiding this comment

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

As I said, WeChat is the most popular IM App in China, nearly everyone uses this app for daily communication, it is one of the major browsers in fact just like safari/chrome(maybe more important than them). So in my opinion this individual rule for WeChat is a significant improvement.
As for the rule itself, because WeChat just use WkWebView for its inline browser, and only iOS >=14.3 the WkWebView supports getusermedia API as well as other WebRTC APIs. In this case, the WeChat's version is not the main constraint, so I think this rule is just OK.

Copy link
Author

Choose a reason for hiding this comment

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

Maybe I made a confusion statement, I mean iOS >=14.3, not WeChat >=14.3, its my fault :)

return 'Safari12';
}
// Safari with Unified-Plan support enabled.
else if (
browser.satisfies({ safari: '>=12.0' }) &&
Expand Down