From 4f9cd6a9aa3f1857f191ef672a83b94a3138b707 Mon Sep 17 00:00:00 2001 From: qcrao Date: Thu, 25 Jul 2024 15:42:36 +0800 Subject: [PATCH] add archive report --- popup.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/popup.js b/popup.js index 707124c..92602db 100644 --- a/popup.js +++ b/popup.js @@ -113,10 +113,7 @@ async function handleBulkArchive() { if (localIsPaid) { chrome.tabs.query({ active: true, currentWindow: true }, ([tab]) => { if (tab) { - chrome.scripting.executeScript({ - target: { tabId: tab.id }, - files: ["bulkArchiveConversations.js"], - }); + loadGlobalsThenExecute(tab.id, "bulkArchiveConversations.js"); } }); return; @@ -139,10 +136,7 @@ async function handleBulkArchive() { if (data.isPaid) { chrome.tabs.query({ active: true, currentWindow: true }, ([tab]) => { if (tab) { - chrome.scripting.executeScript({ - target: { tabId: tab.id }, - files: ["bulkArchiveConversations.js"], - }); + loadGlobalsThenExecute(tab.id, "bulkArchiveConversations.js"); } }); } else {