From ed9419f04b085d53def419012193efc79cb9b678 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Mar 2026 18:13:17 +0000 Subject: [PATCH] fix: test suite CSP compatibility for Firefox extension pages Replace inline onclick handlers with addEventListener (Firefox extension CSP blocks inline event handlers). Show loading state and test count on page load. https://claude.ai/code/session_01KF4i7Ra7zCEDskxDBaNtcT --- test-suite.html | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/test-suite.html b/test-suite.html index 7654017..712b2f3 100644 --- a/test-suite.html +++ b/test-suite.html @@ -29,8 +29,8 @@ Load this page as an extension page (or inject via dev console on the Options page).
Tests exercise sync, encryption, storage, auto-redact, and domain management.

- - + +
@@ -485,7 +485,8 @@ // RUN ALL // ============================================================ - window.runAllTests = async function() { + async function runAllTests() { + document.getElementById('results').innerHTML = '

Running tests...

'; const outcomes = []; for (const t of results) { try { @@ -497,10 +498,18 @@ } } renderResults(outcomes); - }; + } - // Auto-register tests on load + // Wire up buttons (CSP blocks inline onclick) + document.getElementById('btnRunTests').addEventListener('click', runAllTests); + document.getElementById('btnClear').addEventListener('click', () => { + document.getElementById('results').innerHTML = ''; + document.getElementById('summary').textContent = ''; + }); + + // Show ready state console.log(`[Silent Send Tests] ${results.length} tests registered. Click "Run All Tests" to start.`); + document.getElementById('results').innerHTML = `

${results.length} tests loaded. Click "Run All Tests" to start.

`;