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

VIDEO-8374 - Support for WKWebView/SFSafariViewController #149

Merged
merged 3 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
4.6.0 (In Progress)
===================

New Features
------------

- Enabled support for WKWebViews. Thank you @codeborne for your contribution.

4.5.2 (January 4, 2022)
=========================

Expand Down
2 changes: 1 addition & 1 deletion lib/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function guessBrowser(userAgent) {
if (/Firefox|FxiOS/.test(userAgent)) {
return 'firefox';
}
if (/Safari/.test(userAgent)) {
if (/Safari|iPhone|iPad|iPod/.test(userAgent)) {
return 'safari';
}
return null;
Expand Down
25 changes: 25 additions & 0 deletions test/unit/spec/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,31 @@ describe('Util', () => {
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15',
'safari'
],
[
'Safari WKWebView - iPhone',
'Mozilla/5.0 (iPhone; CPU iPhone OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko)',
'safari'
],
[
'Safari WKWebView - iPad',
'Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebkit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
'safari'
],
[
'Safari iOS - Instagram',
'Mozilla/5.0 (iPhone; CPU iPhone OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Instagram 220.0.0.8.117 (iPhone12,3; iOS 15_3; en_US; en; scale=3.00; 1125x2436; 347566818) NW/3',
'safari'
],
[
'Safari iOS - Snapchat',
'Mozilla/5.0 (iPhone; CPU iPhone OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Mobile/15E148 Snapchat/11.64.0.38 (like Safari/8612.4.9.0.3, panda)',
'safari'
],
[
'Safari iOS - Slack ',
'Mozilla/5.0 (iPhone; CPU iPhone OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Mobile/15E148 Safari/604.1',
'safari'
],
[
Copy link
Contributor

Choose a reason for hiding this comment

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

Is one of these user agents from Tim's app?

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, the Safari-WKWebView - iPhone is from Tim's app.

and Safari iOS - Slack is the same as SFSafariViewController UA from Tim's app so it seems like most of the applications we tested on is using SFSafariViewController.

'Edge Desktop (Chromium)',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; Xbox; Xbox One) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edg/15.15063',
Expand Down