Ver código fonte

fix(pwa) move manifest to the root

It must be served from the same origin, so we need to bypass the CDN we use for
meet.jit.si. See the code comments for the rationale on the workaround.
master
Saúl Ibarra Corretgé 5 anos atrás
pai
commit
d067c4e731
3 arquivos alterados com 11 adições e 5 exclusões
  1. 2
    1
      debian/jitsi-meet-web.install
  2. 6
    1
      index.html
  3. 3
    3
      manifest.json

+ 2
- 1
debian/jitsi-meet-web.install Ver arquivo

13
 connection_optimization	/usr/share/jitsi-meet/
13
 connection_optimization	/usr/share/jitsi-meet/
14
 resources/robots.txt	/usr/share/jitsi-meet/
14
 resources/robots.txt	/usr/share/jitsi-meet/
15
 resources/*.sh			/usr/share/jitsi-meet/scripts/
15
 resources/*.sh			/usr/share/jitsi-meet/scripts/
16
-pwa-worker.js /usr/share/jitsi-meet/
16
+pwa-worker.js			/usr/share/jitsi-meet/
17
+manifest.json			/usr/share/jitsi-meet/

+ 6
- 1
index.html Ver arquivo

9
 
9
 
10
     <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
10
     <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
11
     <link rel="stylesheet" href="css/all.css">
11
     <link rel="stylesheet" href="css/all.css">
12
-    <link rel="manifest" href="static/pwa/manifest.json">
12
+    <link rel="manifest" id="manifest-placeholder">
13
+
13
     <script>
14
     <script>
15
+        // Dynamically generate the manifest location URL. It must be served from the document origin, and we may have
16
+        // the base pointing to the CDN. This way we can generate a full URL which will bypass the base.
17
+        document.querySelector('#manifest-placeholder').setAttribute('href', window.location.origin + '/manifest.json');
18
+
14
         document.addEventListener('DOMContentLoaded', () => {
19
         document.addEventListener('DOMContentLoaded', () => {
15
             if (!JitsiMeetJS.app) {
20
             if (!JitsiMeetJS.app) {
16
                 return;
21
                 return;

static/pwa/manifest.json → manifest.json Ver arquivo

11
   "name": "Jitsi Meet",
11
   "name": "Jitsi Meet",
12
   "icons": [
12
   "icons": [
13
     {
13
     {
14
-      "src": "icons/icon192.png",
14
+      "src": "static/pwa/icons/icon192.png",
15
       "type": "image/png",
15
       "type": "image/png",
16
       "sizes": "192x192"
16
       "sizes": "192x192"
17
     },
17
     },
18
     {
18
     {
19
-      "src": "icons/icon512.png",
19
+      "src": "static/pwa/icons/icon512.png",
20
       "type": "image/png",
20
       "type": "image/png",
21
       "sizes": "512x512"
21
       "sizes": "512x512"
22
     },
22
     },
23
     {
23
     {
24
-      "src": "icons/iconMask.png",
24
+      "src": "static/pwa/icons/iconMask.png",
25
       "sizes": "512x512",
25
       "sizes": "512x512",
26
       "type": "image/png",
26
       "type": "image/png",
27
       "purpose": "maskable"
27
       "purpose": "maskable"

Carregando…
Cancelar
Salvar