From c72971edaf2ee0ee85cf65bfe4c73ad9148ce987 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 26 Mar 2026 03:18:59 +0000 Subject: [PATCH] fix: add Reset Everything button + improve reveal mode reliability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Storage issue: Chromium/Brave keeps storage.local data even when an unpacked extension is removed and reloaded. Added "Reset Everything" button in Options → Danger Zone that clears all data (double-confirm to prevent accidents). Reveal mode: Now re-runs revealAllResponses() every 2 seconds while active to catch streamed content and dynamically loaded responses. Adds console logging for reveal toggle state changes to aid debugging. Cleans up interval when reveal mode is turned off. https://claude.ai/code/session_01Dvgwe7XMoSxnWXkih8p1Cw --- src/content/content.js | 12 ++++++++++-- src/options/options.html | 11 +++++++++++ src/options/options.js | 13 +++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/content/content.js b/src/content/content.js index 6089b87..7c3e0ef 100644 --- a/src/content/content.js +++ b/src/content/content.js @@ -740,24 +740,32 @@ // React to reveal mode toggle let prevRevealMode = settings.revealMode; + let revealInterval = null; + function checkRevealToggle() { if (settings.revealMode && !prevRevealMode) { // Just turned ON — reveal everything existing + console.log('[Silent Send] Reveal mode ON'); revealAllResponses(); + // Keep re-revealing periodically to catch new/streamed content + revealInterval = setInterval(() => { + if (settings.revealMode) revealAllResponses(); + }, 2000); } else if (!settings.revealMode && prevRevealMode) { // Just turned OFF — restore originals + console.log('[Silent Send] Reveal mode OFF'); + if (revealInterval) { clearInterval(revealInterval); revealInterval = null; } unrevealAllResponses(); } prevRevealMode = settings.revealMode; } // Hook into config updates to detect reveal toggle - const origMessageHandler = window.addEventListener; window.addEventListener('message', (event) => { if (event.source !== window) return; if (event.data?.type === 'ss:config-updated') { // Settings were updated — check if reveal mode changed - setTimeout(checkRevealToggle, 50); + setTimeout(checkRevealToggle, 100); } }); diff --git a/src/options/options.html b/src/options/options.html index ccdc299..2a9312f 100644 --- a/src/options/options.html +++ b/src/options/options.html @@ -135,6 +135,17 @@
+
+

Danger Zone

+
+
+ +

Clears all identities, mappings, settings, and logs. Cannot be undone.

+
+ +
+
+ diff --git a/src/options/options.js b/src/options/options.js index 9983aa4..b3fd320 100644 --- a/src/options/options.js +++ b/src/options/options.js @@ -92,6 +92,19 @@ document.addEventListener('DOMContentLoaded', async () => { await Storage.clearLog(); renderLog(); }); + + // Reset all data + $('#btnResetAll').addEventListener('click', async () => { + if (!confirm('This will delete ALL your identities, mappings, settings, and logs.\n\nAre you sure?')) return; + if (!confirm('Really? This cannot be undone.')) return; + await api.storage.local.clear(); + mappings = []; + settings = {}; + renderMappings(); + renderDomains(); + renderLog(); + alert('All data cleared. Reload the extension to start fresh.'); + }); }); async function addMapping() {