From 079541e84be97a438829a5ed394913de9eaeb44c Mon Sep 17 00:00:00 2001 From: sneak Date: Wed, 25 Feb 2026 15:59:50 +0700 Subject: [PATCH] Add DEBUG mode with red banner and hardcoded mnemonic When DEBUG=true: a sticky red "DEBUG / INSECURE" banner appears at the top of all views, and the die button returns a hardcoded test mnemonic instead of generating a random one. --- src/popup/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/popup/index.js b/src/popup/index.js index 54aee24..7b6de77 100644 --- a/src/popup/index.js +++ b/src/popup/index.js @@ -1,6 +1,10 @@ // AutistMask popup UI — view management and event wiring const { Mnemonic } = require("ethers"); +const DEBUG = true; +const DEBUG_MNEMONIC = + "cube evolve unfold result inch risk jealous skill hotel bulb night wreck"; + const VIEWS = [ "lock", "welcome", @@ -71,6 +75,7 @@ function makeStubAddress() { } function generateMnemonic() { + if (DEBUG) return DEBUG_MNEMONIC; const wallet = Mnemonic.fromEntropy( globalThis.crypto.getRandomValues(new Uint8Array(16)), ); @@ -239,6 +244,14 @@ function backFromWalletAdd() { // -- init -- function init() { + if (DEBUG) { + const banner = document.createElement("div"); + banner.textContent = "DEBUG / INSECURE"; + banner.style.cssText = + "background:#c00;color:#fff;text-align:center;font-size:10px;padding:1px 0;font-family:monospace;position:sticky;top:0;z-index:9999;"; + document.body.prepend(banner); + } + if (!state.hasWallet) { showView("welcome"); } else if (state.locked) {