Clear cache on relaod

This commit is contained in:
2026-08-05 23:36:34 -05:00
parent 49bc022909
commit 1fb42334ae
9 changed files with 103 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
const statusEl = document.getElementById("status");
const listEl = document.getElementById("urlList");
const openHistoryBtn = document.getElementById("openHistoryBtn");
const clearBtn = document.getElementById("clearBtn");
function setStatus(message) {
statusEl.textContent = message;
@@ -153,6 +154,22 @@ openHistoryBtn.addEventListener("click", async () => {
window.close();
});
if (clearBtn) {
clearBtn.addEventListener("click", async () => {
const confirmed = window.confirm("Clear all captured samples and history?");
if (!confirmed) {
return;
}
const result = await browser.runtime.sendMessage({ type: "CLEAR_CAPTURED_STATE" });
if (!result || !result.ok) {
setStatus("Unable to clear captured samples.");
return;
}
await loadCapturedUrls();
setStatus("Captured samples cleared.");
});
}
loadCapturedUrls().catch(() => {
setStatus("Unexpected error while loading URLs.");
});