From 3b1adc89a361fd4c1a0552673c621a06f041dc75 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 24 Jun 2026 23:28:45 -0700 Subject: Drop beforeinstallprompt preventDefault to silence its console warning preventDefault() without a following prompt() makes Chrome log a 'Banner not shown' warning. Modern Chrome shows no auto-banner to suppress, so we just stash the event for our own install link without preventing the default. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/app.js b/src/app.js index 86e62a0..dee907c 100644 --- a/src/app.js +++ b/src/app.js @@ -161,6 +161,9 @@ function toggleTheme() { // browser requires a gesture). The link's visibility is driven by a persisted // flag rather than the live event so it's present on the first paint after a // refresh (no layout shift); the event only supplies the prompt to replay. +// We deliberately do NOT call e.preventDefault(): modern Chrome shows no banner +// of its own to suppress, and preventDefault-without-prompt() logs a console +// warning. The event stays usable for our own e.prompt() on tap. const INSTALLABLE_KEY = 'btc-wallet-installable'; let installPrompt = null; function isStandalone() { @@ -180,7 +183,6 @@ function setInstallable(v) { } if (typeof window !== 'undefined') { window.addEventListener('beforeinstallprompt', (e) => { - e.preventDefault(); installPrompt = e; // Only re-render if this changes what's on screen; on a refresh the link is // already shown from the persisted flag, so nothing moves. -- cgit v1.2.3