From 366d7bbd8389e3696a838291a63e10c02ffa759c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20Z=C3=BCger?= Date: Wed, 1 Apr 2026 22:39:39 +0200 Subject: [PATCH] Fix PWA install prompt missing in Chromium browsers The manifest icon paths pointed to root (e.g. /android-chrome-192x192.png) instead of /favicons/android-chrome-192x192.png. Root-level requests hit the Firebase SPA rewrite and returned HTML, so Chromium saw invalid icons and suppressed the install prompt. Remove static manifest.json files whose icon paths were inherited verbatim by generateManifest(). The auto-discovery path already produces correct /favicons/ prefixed paths for all themes. Also remove unused site.webmanifest files from theme directories. --- gulpfile.js | 25 +++++-------- theme/lspl/favicons/site.webmanifest | 1 - theme/lspv/favicons/site.webmanifest | 1 - theme/lsze/favicons/site.webmanifest | 1 - theme/lszk/favicons/manifest.json | 37 ------------------- theme/lszm/favicons/site.webmanifest | 1 - theme/lszo/favicons/site.webmanifest | 1 - theme/lszt/favicons/manifest.json | 53 ---------------------------- 8 files changed, 9 insertions(+), 111 deletions(-) delete mode 100644 theme/lspl/favicons/site.webmanifest delete mode 100644 theme/lspv/favicons/site.webmanifest delete mode 100644 theme/lsze/favicons/site.webmanifest delete mode 100644 theme/lszk/favicons/manifest.json delete mode 100644 theme/lszm/favicons/site.webmanifest delete mode 100644 theme/lszo/favicons/site.webmanifest delete mode 100644 theme/lszt/favicons/manifest.json diff --git a/gulpfile.js b/gulpfile.js index f77cf566..a8550b55 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -89,22 +89,15 @@ function generateManifest(done) { const themeName = projectConf.theme; const faviconDir = path.join(__dirname, 'theme', themeName, 'favicons'); - const manifestPath = path.join(faviconDir, 'manifest.json'); - - let icons; - if (fs.existsSync(manifestPath)) { - const existing = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); - icons = existing.icons || []; - } else { - const pngFiles = fs.existsSync(faviconDir) - ? fs.readdirSync(faviconDir).filter(f => f.startsWith('android-chrome') && f.endsWith('.png')) - : []; - icons = pngFiles.map(f => { - const match = f.match(/(\d+)x(\d+)/); - const size = match ? `${match[1]}x${match[2]}` : '192x192'; - return { src: `/favicons/${f}`, sizes: size, type: 'image/png' }; - }); - } + + const pngFiles = fs.existsSync(faviconDir) + ? fs.readdirSync(faviconDir).filter(f => f.startsWith('android-chrome') && f.endsWith('.png')) + : []; + const icons = pngFiles.map(f => { + const match = f.match(/(\d+)x(\d+)/); + const size = match ? `${match[1]}x${match[2]}` : '192x192'; + return { src: `/favicons/${f}`, sizes: size, type: 'image/png' }; + }); const manifest = { name: projectConf.title, diff --git a/theme/lspl/favicons/site.webmanifest b/theme/lspl/favicons/site.webmanifest deleted file mode 100644 index 45dc8a20..00000000 --- a/theme/lspl/favicons/site.webmanifest +++ /dev/null @@ -1 +0,0 @@ -{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} \ No newline at end of file diff --git a/theme/lspv/favicons/site.webmanifest b/theme/lspv/favicons/site.webmanifest deleted file mode 100644 index 45dc8a20..00000000 --- a/theme/lspv/favicons/site.webmanifest +++ /dev/null @@ -1 +0,0 @@ -{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} \ No newline at end of file diff --git a/theme/lsze/favicons/site.webmanifest b/theme/lsze/favicons/site.webmanifest deleted file mode 100644 index 45dc8a20..00000000 --- a/theme/lsze/favicons/site.webmanifest +++ /dev/null @@ -1 +0,0 @@ -{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} \ No newline at end of file diff --git a/theme/lszk/favicons/manifest.json b/theme/lszk/favicons/manifest.json deleted file mode 100644 index 0877aadf..00000000 --- a/theme/lszk/favicons/manifest.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "FGZO Bewegungen", - "icons": [ - { - "src": "\/android-chrome-36x36.png", - "sizes": "36x36", - "type": "image\/png" - }, - { - "src": "\/android-chrome-48x48.png", - "sizes": "48x48", - "type": "image\/png" - }, - { - "src": "\/android-chrome-72x72.png", - "sizes": "72x72", - "type": "image\/png" - }, - { - "src": "\/android-chrome-96x96.png", - "sizes": "96x96", - "type": "image\/png" - }, - { - "src": "\/android-chrome-144x144.png", - "sizes": "144x144", - "type": "image\/png" - }, - { - "src": "\/android-chrome-192x192.png", - "sizes": "192x192", - "type": "image\/png" - } - ], - "theme_color": "#ffffff", - "display": "standalone" -} diff --git a/theme/lszm/favicons/site.webmanifest b/theme/lszm/favicons/site.webmanifest deleted file mode 100644 index 45dc8a20..00000000 --- a/theme/lszm/favicons/site.webmanifest +++ /dev/null @@ -1 +0,0 @@ -{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} \ No newline at end of file diff --git a/theme/lszo/favicons/site.webmanifest b/theme/lszo/favicons/site.webmanifest deleted file mode 100644 index 45dc8a20..00000000 --- a/theme/lszo/favicons/site.webmanifest +++ /dev/null @@ -1 +0,0 @@ -{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} \ No newline at end of file diff --git a/theme/lszt/favicons/manifest.json b/theme/lszt/favicons/manifest.json deleted file mode 100644 index a4c79988..00000000 --- a/theme/lszt/favicons/manifest.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "MFGT Bewegungen", - "icons": [ - { - "src": "/android-chrome-36x36.png?v=2", - "sizes": "36x36", - "type": "image/png" - }, - { - "src": "/android-chrome-48x48.png?v=2", - "sizes": "48x48", - "type": "image/png" - }, - { - "src": "/android-chrome-72x72.png?v=2", - "sizes": "72x72", - "type": "image/png" - }, - { - "src": "/android-chrome-96x96.png?v=2", - "sizes": "96x96", - "type": "image/png" - }, - { - "src": "/android-chrome-144x144.png?v=2", - "sizes": "144x144", - "type": "image/png" - }, - { - "src": "/android-chrome-192x192.png?v=2", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "/android-chrome-256x256.png?v=2", - "sizes": "256x256", - "type": "image/png" - }, - { - "src": "/android-chrome-384x384.png?v=2", - "sizes": "384x384", - "type": "image/png" - }, - { - "src": "/android-chrome-512x512.png?v=2", - "sizes": "512x512", - "type": "image/png" - } - ], - "theme_color": "#ffffff", - "background_color": "#ffffff", - "display": "standalone" -}