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

Add support for iOS applications serving a webpage inside WKWebView #133

Closed
wants to merge 5 commits into from
Closed
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
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/.test(userAgent)) {
return 'safari';
}
return null;
Expand Down
10 changes: 10 additions & 0 deletions test/unit/spec/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ 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 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
'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'
],
[
'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