Explorar el Código

Merge pull request #1790 from jitsi/tavram/safari-13

fix(browser) Mark safari <14 as unsupported
tags/v0.0.2
Avram Tudor hace 4 años
padre
commit
b337778da8
No account linked to committer's email address
Se han modificado 1 ficheros con 18 adiciones y 0 borrados
  1. 18
    0
      modules/browser/BrowserCapabilities.js

+ 18
- 0
modules/browser/BrowserCapabilities.js Ver fichero

@@ -5,6 +5,7 @@ const logger = getLogger(__filename);
5 5
 
6 6
 /* Minimum required Chrome / Chromium version. This applies also to derivatives. */
7 7
 const MIN_REQUIRED_CHROME_VERSION = 72;
8
+const MIN_REQUIRED_SAFARI_VERSION = 14;
8 9
 
9 10
 // TODO: Move this code to js-utils.
10 11
 
@@ -101,6 +102,10 @@ export default class BrowserCapabilities extends BrowserDetection {
101 102
      * @returns {boolean} true if the browser is supported, false otherwise.
102 103
      */
103 104
     isSupported() {
105
+        if (this.isSafari() && this._getSafariVersion() < MIN_REQUIRED_SAFARI_VERSION) {
106
+            return false;
107
+        }
108
+
104 109
         return (this.isChromiumBased() && this._getChromiumBasedVersion() >= MIN_REQUIRED_CHROME_VERSION)
105 110
             || this.isFirefox()
106 111
             || this.isReactNative()
@@ -363,4 +368,17 @@ export default class BrowserCapabilities extends BrowserDetection {
363 368
 
364 369
         return -1;
365 370
     }
371
+
372
+    /**
373
+     * Returns the version of a Safari browser.
374
+     *
375
+     * @returns {Number}
376
+     */
377
+    _getSafariVersion() {
378
+        if (this.isSafari()) {
379
+            return Number.parseInt(this.getVersion(), 10);
380
+        }
381
+
382
+        return -1;
383
+    }
366 384
 }

Loading…
Cancelar
Guardar