From 5e2d392e8ee4ecb5115104d6490e3bd1da5521e7 Mon Sep 17 00:00:00 2001 From: Tobi Date: Tue, 9 Apr 2024 10:33:04 +0200 Subject: [PATCH] debugging PWA --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 453ab50..adb62c2 100644 --- a/index.html +++ b/index.html @@ -191,11 +191,11 @@ document.getElementById('installButton').style.display = 'none'; } - // Show installation instructions only if app is not already installed - window.addEventListener('beforeinstallprompt', (event) => { - event.preventDefault(); + // Show installation instructions only if accessed via browser + if (!window.matchMedia('(display-mode: standalone)').matches) { document.getElementById('install-instructions').style.display = 'block'; - }); + document.getElementById('installButton').style.display = 'block'; + }