Procházet zdrojové kódy

fix(browser-support) fix detecting iOS browsers correctly

There was an error in the pattern match, everything was included in it. In
addition return a boolean in case we succeed in the UA pattern match, since it's
more correct than returning an array with the match.
release-8443
Saúl Ibarra Corretgé před 4 roky
rodič
revize
c15dda1537
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2
    2
      modules/browser/BrowserCapabilities.js

+ 2
- 2
modules/browser/BrowserCapabilities.js Zobrazit soubor

@@ -64,8 +64,8 @@ export default class BrowserCapabilities extends BrowserDetection {
64 64
     isIosBrowser() {
65 65
         const { userAgent, maxTouchPoints, platform } = navigator;
66 66
 
67
-        return userAgent.match(/iP(ad|hone|od)/i
68
-            || (maxTouchPoints && maxTouchPoints > 2 && /MacIntel/.test(platform)));
67
+        return Boolean(userAgent.match(/iP(ad|hone|od)/i))
68
+            || (maxTouchPoints && maxTouchPoints > 2 && /MacIntel/.test(platform));
69 69
     }
70 70
 
71 71
     /**

Načítá se…
Zrušit
Uložit