From d5e0dea4692bfb93d3cdc01e27f902e4395309f7 Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Thu, 20 Jun 2019 08:43:31 -0700 Subject: [PATCH] fix(suboptimal): ignore mobile browsers in whitelists/blacklists --- .../features/base/environment/environment.js | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/react/features/base/environment/environment.js b/react/features/base/environment/environment.js index 511938546..cbde9bd86 100644 --- a/react/features/base/environment/environment.js +++ b/react/features/base/environment/environment.js @@ -66,11 +66,10 @@ export function isSupportedBrowser() { return false; } - const isBlacklistedBrowser = _isCurrentBrowserInList( + // Blacklists apply to desktop browsers only right now. + if (!_isMobileBrowser() && _isCurrentBrowserInList( interfaceConfig.UNSUPPORTED_BROWSERS || DEFAULT_UNSUPPORTED_BROWSERS - ); - - if (isBlacklistedBrowser) { + )) { return false; } @@ -78,9 +77,7 @@ export function isSupportedBrowser() { // - the WelcomePage is mobile ready; // - if the URL points to a conference then deep-linking will take // care of it. - return Platform.OS === 'android' - || Platform.OS === 'ios' - || JitsiMeetJS.isWebRtcSupported(); + return _isMobileBrowser() || JitsiMeetJS.isWebRtcSupported(); } /** @@ -99,3 +96,13 @@ function _isCurrentBrowserInList(list) { return checkFunction ? checkFunction.call(browser) : false; })); } + +/** + * Returns whether or not the current environment is a mobile device. + * + * @private + * @returns {boolean} + */ +function _isMobileBrowser() { + return Platform.OS === 'android' || Platform.OS === 'ios'; +}