aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-24 23:28:45 -0700
committerAdam Soltys <[email protected]>2026-06-24 23:28:45 -0700
commit3b1adc89a361fd4c1a0552673c621a06f041dc75 (patch)
treed500c504174907ed3fbda901dbf5c180ab17a9eb /src
parent7af3c430d49d7817e9a0cf28ab49143edba4c00f (diff)
downloadcoinosv3-3b1adc89a361fd4c1a0552673c621a06f041dc75.tar.gz
coinosv3-3b1adc89a361fd4c1a0552673c621a06f041dc75.zip
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) <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/app.js4
1 files changed, 3 insertions, 1 deletions
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.