From d468703f1691b112aec3e5b580f4a212362019b6 Mon Sep 17 00:00:00 2001 From: Zetaphor Date: Wed, 5 Aug 2026 23:12:56 -0500 Subject: [PATCH] Filter popup --- popup.js | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/popup.js b/popup.js index 00c4314..7df3d42 100644 --- a/popup.js +++ b/popup.js @@ -128,32 +128,21 @@ function buildRow(entry) { } async function loadCapturedUrls() { - const tabs = await browser.tabs.query({ active: true, currentWindow: true }); - const activeTab = tabs[0]; - - if (!activeTab || typeof activeTab.id !== "number") { - setStatus("No active tab found."); - return; - } - - const response = await browser.runtime.sendMessage({ - type: "GET_TAB_URLS", - tabId: activeTab.id - }); + const response = await browser.runtime.sendMessage({ type: "GET_HISTORY" }); if (!response || !response.ok) { - setStatus("Unable to load captured URLs."); + setStatus("Unable to load captured samples."); return; } listEl.innerHTML = ""; - const entries = Array.isArray(response.entries) ? response.entries : []; + const entries = Array.isArray(response.history) ? response.history : []; if (!entries.length) { - setStatus("No captured samples for this tab yet."); + setStatus("No captured samples yet."); return; } - setStatus(`Captured samples for this tab: ${entries.length}`); + setStatus(`Captured samples: ${entries.length}`); for (const entry of entries) { listEl.appendChild(buildRow(entry)); }