Selaa lähdekoodia

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.
j8
Saúl Ibarra Corretgé 4 vuotta sitten
vanhempi
commit
d067c4e731
3 muutettua tiedostoa jossa 11 lisäystä ja 5 poistoa
  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 Näytä tiedosto

@@ -13,4 +13,5 @@ lang					/usr/share/jitsi-meet/
13 13
 connection_optimization	/usr/share/jitsi-meet/
14 14
 resources/robots.txt	/usr/share/jitsi-meet/
15 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 Näytä tiedosto

@@ -9,8 +9,13 @@
9 9
 
10 10
     <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
11 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 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 19
         document.addEventListener('DOMContentLoaded', () => {
15 20
             if (!JitsiMeetJS.app) {
16 21
                 return;

static/pwa/manifest.json → manifest.json Näytä tiedosto

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

Loading…
Peruuta
Tallenna