From 9cda1eb6a5cf0a784abde5979b00b18a3e0c70f8 Mon Sep 17 00:00:00 2001 From: Tobi Date: Tue, 9 Apr 2024 10:48:14 +0200 Subject: [PATCH] debugging PWA --- index.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/index.html b/index.html index 50e2d0c..47ae491 100644 --- a/index.html +++ b/index.html @@ -162,11 +162,21 @@ }); } + // Show installation instructions only if accessed via browser + if (window.matchMedia('(display-mode: browser)').matches) { + document.getElementById('install-instructions').style.display = 'block'; + } + // Hide installation instructions once installed as standalone PWA window.addEventListener('beforeinstallprompt', (event) => { event.preventDefault(); // Prevent default browser prompt document.getElementById('install-instructions').style.display = 'none'; }); + + // Check if launched from home screen and hide instructions + if (window.matchMedia('(display-mode: standalone)').matches) { + document.getElementById('install-instructions').style.display = 'none'; + }