1 Commits
1.0 ... signed

Author SHA1 Message Date
d468703f16 Filter popup 2026-08-05 23:12:56 -05:00

View File

@@ -128,32 +128,21 @@ function buildRow(entry) {
} }
async function loadCapturedUrls() { async function loadCapturedUrls() {
const tabs = await browser.tabs.query({ active: true, currentWindow: true }); const response = await browser.runtime.sendMessage({ type: "GET_HISTORY" });
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
});
if (!response || !response.ok) { if (!response || !response.ok) {
setStatus("Unable to load captured URLs."); setStatus("Unable to load captured samples.");
return; return;
} }
listEl.innerHTML = ""; listEl.innerHTML = "";
const entries = Array.isArray(response.entries) ? response.entries : []; const entries = Array.isArray(response.history) ? response.history : [];
if (!entries.length) { if (!entries.length) {
setStatus("No captured samples for this tab yet."); setStatus("No captured samples yet.");
return; return;
} }
setStatus(`Captured samples for this tab: ${entries.length}`); setStatus(`Captured samples: ${entries.length}`);
for (const entry of entries) { for (const entry of entries) {
listEl.appendChild(buildRow(entry)); listEl.appendChild(buildRow(entry));
} }