Browse Source

fix(pwa) bypass loading in electron. ensure same origin with registrator

master
Tudor-Ovidiu Avram 4 years ago
parent
commit
e4c1046d7c
2 changed files with 8 additions and 1 deletions
  1. 0
    1
      index.html
  2. 8
    0
      react/index.web.js

+ 0
- 1
index.html View File

@@ -161,7 +161,6 @@
161 161
     <script><!--#include virtual="/logging_config.js" --></script>
162 162
     <script src="libs/lib-jitsi-meet.min.js?v=139"></script>
163 163
     <script src="libs/app.bundle.min.js?v=139"></script>
164
-    <script src="static/pwa/registrator.js" async></script>
165 164
     <!--#include virtual="title.html" -->
166 165
     <!--#include virtual="plugin.head.html" -->
167 166
     <!--#include virtual="static/welcomePageAdditionalContent.html" -->

+ 8
- 0
react/index.web.js View File

@@ -6,9 +6,11 @@ import ReactDOM from 'react-dom';
6 6
 import { getJitsiMeetTransport } from '../modules/transport';
7 7
 
8 8
 import { App } from './features/app/components';
9
+import { browser } from './features/base/lib-jitsi-meet';
9 10
 import { getLogger } from './features/base/logging/functions';
10 11
 import { Platform } from './features/base/react';
11 12
 import { getJitsiMeetGlobalNS } from './features/base/util';
13
+import { loadScript } from './features/base/util/loadScript';
12 14
 import PrejoinApp from './features/prejoin/components/PrejoinApp';
13 15
 
14 16
 const logger = getLogger('index.web');
@@ -22,6 +24,12 @@ document.addEventListener('DOMContentLoaded', () => {
22 24
 
23 25
     APP.connectionTimes['document.ready'] = now;
24 26
     logger.log('(TIME) document ready:\t', now);
27
+
28
+    if (!browser.isElectron()) {
29
+        const base = window.location.origin;
30
+
31
+        loadScript(`${base}/static/pwa/registrator.js`);
32
+    }
25 33
 });
26 34
 
27 35
 // Workaround for the issue when returning to a page with the back button and

Loading…
Cancel
Save