Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(UnsupportedMobileBrowser): do not include protocol in the intent

paweldomas40d7d0c9cb07
diff --git a/react/features/base/util/uri.js b/react/features/base/util/uri.js
index 672f945d12..b742dd3474 100644
--- a/react/features/base/util/uri.js
+++ b/react/features/base/util/uri.js
@@ -25,10 +25,14 @@ const _URI_PATH_PATTERN = '([^?#]*)';
/**
* The {@link RegExp} pattern of the protocol of a URI.
*
- * @private
+ * FIXME: The URL class exposed by JavaScript will not include the colon in
+ * the protocol field. Also in other places (at the time of this writing:
+ * the UnsupportedMobileBrowser.js) the APP_LINK_SCHEME does not include
+ * the double dots, so things are inconsistent.
+ *
* @type {string}
*/
-const _URI_PROTOCOL_PATTERN = '([a-z][a-z0-9\\.\\+-]*:)';
+export const URI_PROTOCOL_PATTERN = '([a-z][a-z0-9\\.\\+-]*:)';
/**
* Fixes the hier-part of a specific URI (string) so that the URI is well-known.
@@ -47,7 +51,7 @@ function _fixURIStringHierPart(uri) {
// hipchat.com
let regex
= new RegExp(
- `^${_URI_PROTOCOL_PATTERN}//hipchat\\.com/video/call/`,
+ `^${URI_PROTOCOL_PATTERN}//hipchat\\.com/video/call/`,
'gi');
let match: Array<string> | null = regex.exec(uri);
@@ -55,7 +59,7 @@ function _fixURIStringHierPart(uri) {
// enso.me
regex
= new RegExp(
- `^${_URI_PROTOCOL_PATTERN}//enso\\.me/(?:call|meeting)/`,
+ `^${URI_PROTOCOL_PATTERN}//enso\\.me/(?:call|meeting)/`,
'gi');
match = regex.exec(uri);
}
@@ -87,7 +91,7 @@ function _fixURIStringHierPart(uri) {
* @returns {string}
*/
function _fixURIStringScheme(uri: string) {
- const regex = new RegExp(`^${_URI_PROTOCOL_PATTERN}+`, 'gi');
+ const regex = new RegExp(`^${URI_PROTOCOL_PATTERN}+`, 'gi');
const match: Array<string> | null = regex.exec(uri);
if (match) {
@@ -191,7 +195,7 @@ export function parseStandardURIString(str: string) {
str = str.replace(/\s/g, '');
// protocol
- regex = new RegExp(`^${_URI_PROTOCOL_PATTERN}`, 'gi');
+ regex = new RegExp(`^${URI_PROTOCOL_PATTERN}`, 'gi');
match = regex.exec(str);
if (match) {
obj.protocol = match[1].toLowerCase();
diff --git a/react/features/unsupported-browser/components/UnsupportedMobileBrowser.js b/react/features/unsupported-browser/components/UnsupportedMobileBrowser.js
index 644c03ae66..7d0381a391 100644
--- a/react/features/unsupported-browser/components/UnsupportedMobileBrowser.js
+++ b/react/features/unsupported-browser/components/UnsupportedMobileBrowser.js
@@ -6,6 +6,7 @@ import { connect } from 'react-redux';
import { translate, translateToHTML } from '../../base/i18n';
import { Platform } from '../../base/react';
+import { URI_PROTOCOL_PATTERN } from '../../base/util';
import { DialInSummary } from '../../invite';
import HideNotificationBarStyle from './HideNotificationBarStyle';
@@ -82,7 +83,11 @@ class UnsupportedMobileBrowser extends Component<*, *> {
// appears to be a link with an app-specific scheme, not a Universal
// Link.
const appScheme = interfaceConfig.MOBILE_APP_SCHEME || 'org.jitsi.meet';
- const joinURL = `${appScheme}:${window.location.href}`;
+
+ // Replace the protocol part with the app scheme.
+ const joinURL
+ = window.location.href.replace(
+ new RegExp(`^${URI_PROTOCOL_PATTERN}`), `${appScheme}:`);
this.setState({
joinURL