Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(rn) improve UA string
Saúl Ibarra Corretgé771f5af59dfa
diff --git a/react/features/mobile/polyfills/browser.js b/react/features/mobile/polyfills/browser.jsindex 6bd172791b..ab4d8df063 100644--- a/react/features/mobile/polyfills/browser.js+++ b/react/features/mobile/polyfills/browser.js@@ -1,6 +1,6 @@import { DOMParser } from '@xmldom/xmldom';import { atob, btoa } from 'abab';-import { Platform } from 'react-native';+import { NativeModules, Platform } from 'react-native';import BackgroundTimer from 'react-native-background-timer';import { TextDecoder, TextEncoder } from 'text-encoding';@@ -9,6 +9,8 @@ import 'react-native-url-polyfill/auto'; // Complete URL polyfill.import Storage from './Storage';+const { AppInfo } = NativeModules;+/*** Implements an absolute minimum of the common logic of* {@code Document.querySelector} and {@code Element.querySelector}. Implements@@ -254,25 +256,27 @@ function _visitNode(node, callback) {//// Required by:// - lib-jitsi-meet/modules/browser/BrowserDetection.js- let userAgent = navigator.userAgent || '';-- // react-native/version- const { name, version } = require('react-native/package.json');- let rn = name || 'react-native';- version && (rn += `/${version}`);- if (userAgent.indexOf(rn) === -1) {- userAgent = userAgent ? `${rn} ${userAgent}` : rn;- }+ // React Native version+ const { reactNativeVersion } = Platform.constants;+ const rnVersion+ = `react-native/${reactNativeVersion.major}.${reactNativeVersion.minor}.${reactNativeVersion.patch}`;// (OS version)- const os = `(${Platform.OS} ${Platform.Version})`;+ const os = `(${Platform.OS}/${Platform.Version})`;- if (userAgent.indexOf(os) === -1) {- userAgent = userAgent ? `${userAgent} ${os}` : os;- }+ // SDK+ const liteTxt = AppInfo.isLiteSDK ? '-lite' : '';+ const sdkVersion = `JitsiMeetSDK/${AppInfo.sdkVersion}${liteTxt}`;++ const parts = [+ navigator.userAgent ?? '',+ sdkVersion,+ os,+ rnVersion+ ];- navigator.userAgent = userAgent;+ navigator.userAgent = parts.filter(Boolean).join(' ');}// WebRTC