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) {