Skip to content

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

[RN] Fix remote JS debugging

Lyubo Marinovaef6e33c91e0
diff --git a/react/features/app/actions.js b/react/features/app/actions.js
index 26a995c1a4..f2455ff471 100644
--- a/react/features/app/actions.js
+++ b/react/features/app/actions.js
@@ -43,7 +43,6 @@ export function appNavigate(uri) {
domain
= _parseURIString(state['features/app'].app._getDefaultURL())
.domain;
-
}
// TODO Kostiantyn Tsaregradskyi: We should probably detect if user is
diff --git a/react/features/app/components/AbstractApp.js b/react/features/app/components/AbstractApp.js
index b3cb4f664a..f4818d75e5 100644
--- a/react/features/app/components/AbstractApp.js
+++ b/react/features/app/components/AbstractApp.js
@@ -125,6 +125,21 @@ export class AbstractApp extends Component {
dispatch(appWillUnmount(this));
}
+ /**
+ * Gets a Location object from the window with information about the current
+ * location of the document. Explicitly defined to allow extenders to
+ * override because React Native does not usually have a location property
+ * on its window unless debugging remotely in which case the browser that is
+ * the remote debugger will provide a location property on the window.
+ *
+ * @public
+ * @returns {Location} A Location object with information about the current
+ * location of the document.
+ */
+ getWindowLocation() {
+ return undefined;
+ }
+
/**
* Implements React's {@link Component#render()}.
*
@@ -226,7 +241,7 @@ export class AbstractApp extends Component {
// If the execution environment provides a Location abstraction, then
// this App at already at that location but it must be made aware of the
// fact.
- const windowLocation = this._getWindowLocation();
+ const windowLocation = this.getWindowLocation();
if (windowLocation) {
const href = windowLocation.toString();
@@ -272,21 +287,6 @@ export class AbstractApp extends Component {
return store;
}
- /**
- * Gets a Location object from the window with information about the current
- * location of the document. Explicitly defined to allow extenders to
- * override because React Native does not usually have a location property
- * on its window unless debugging remotely in which case the browser that is
- * the remote debugger will provide a location property on the window.
- *
- * @protected
- * @returns {Location} A Location object with information about the current
- * location of the document.
- */
- _getWindowLocation() {
- return undefined;
- }
-
/**
* Creates a Redux store to be used by this AbstractApp if such as store is
* not defined by the consumer of this AbstractApp through its
diff --git a/react/features/app/components/App.web.js b/react/features/app/components/App.web.js
index 38cdfed017..c2dc8d129b 100644
--- a/react/features/app/components/App.web.js
+++ b/react/features/app/components/App.web.js
@@ -52,7 +52,7 @@ export class App extends AbstractApp {
*
* @inheritdoc
*/
- _getWindowLocation() {
+ getWindowLocation() {
return window.location;
}
@@ -63,7 +63,7 @@ export class App extends AbstractApp {
* @returns {string} The context root of window.location i.e. this Web App.
*/
_getWindowLocationContextRoot() {
- const pathname = this._getWindowLocation().pathname;
+ const pathname = this.getWindowLocation().pathname;
const contextRootEndIndex = pathname.lastIndexOf('/');
return (
@@ -93,7 +93,7 @@ export class App extends AbstractApp {
path = this._routePath2WindowLocationPathname(path);
// Navigate to the specified Route.
- const windowLocation = this._getWindowLocation();
+ const windowLocation = this.getWindowLocation();
if (windowLocation.pathname === path) {
// The browser is at the specified path already and what remains is
diff --git a/react/features/unsupported-browser/middleware.js b/react/features/unsupported-browser/middleware.js
index 011614756a..76b473203b 100644
--- a/react/features/unsupported-browser/middleware.js
+++ b/react/features/unsupported-browser/middleware.js
@@ -40,7 +40,8 @@ function _setWebRTCReady(store, next, action) {
// execution enviroment has changed. The current location is not necessarily
// available through window.location (e.g. on mobile) but the following
// works at the time of this writing.
- const windowLocation = window.location;
+ const windowLocation
+ = store.getState()['features/app'].app.getWindowLocation();
if (windowLocation) {
const href = windowLocation.href;