Skip to content

Commit

Permalink
Fix for iOS webview matching.
Browse files Browse the repository at this point in the history
  • Loading branch information
VashurkinAnton committed Feb 10, 2021
1 parent dc07788 commit fbe015d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/express-useragent.js
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,9 @@
* boolean flag `isiOSStandalone`, `isiOSUiwebview` and `isAndroidWebview` will be set as side effect.
*/
UserAgent.prototype.testWebview = function() {
if (this.Agent.os === 'iOS' && isBrowser) {
var isiOS = ['iOS', 'OS X'].indexOf(this.Agent.os) !== -1 || (this.Agent.isiPad || this.Agent.isiPod || this.Agent.isiPhone);

if (isiOS && isBrowser) {
if (window.navigator.standalone && !this.Agent.isSafari) {
this.Agent.isiOSStandalone = true;
} else if (!window.navigator.standalone && !this.Agent.isSafari) {
Expand Down
Loading

0 comments on commit fbe015d

Please sign in to comment.