diff --git a/bulkArchiveConversations.js b/bulkArchiveConversations.js index edb31bd..b8ea28b 100644 --- a/bulkArchiveConversations.js +++ b/bulkArchiveConversations.js @@ -50,7 +50,7 @@ async function archiveConversation(checkbox) { console.log("1. Hovering over conversation...", conversationElement); - const interactiveElement = conversationElement.querySelector("[draggable]"); + const interactiveElement = conversationElement.querySelector(Selectors.INTERACTIVE_ELEMENT_SELECTOR); if (!interactiveElement) { console.log("Skipping conversation - no interactive elements found"); // Show notification to user diff --git a/bulkDeleteConversations.js b/bulkDeleteConversations.js index e20e97f..46b4757 100644 --- a/bulkDeleteConversations.js +++ b/bulkDeleteConversations.js @@ -63,7 +63,7 @@ async function deleteConversation(checkbox) { console.log("conversationElement", conversationElement); // Look for interactive element within the conversation element - const interactiveElement = conversationElement.querySelector("[draggable]"); + const interactiveElement = conversationElement.querySelector(Selectors.INTERACTIVE_ELEMENT_SELECTOR); if (!interactiveElement) { console.log("Skipping conversation - no interactive elements found"); // Show notification to user diff --git a/globals.js b/globals.js index 09e1b7f..fe21aec 100644 --- a/globals.js +++ b/globals.js @@ -12,6 +12,7 @@ if (typeof window.globalsLoaded === "undefined") { CONVERSATION_SELECTOR: 'li[data-testid^="history-item-"]', // 更新标题选择器,保持相对路径 TITLE_SELECTOR: ".relative.grow.overflow-hidden.whitespace-nowrap", + INTERACTIVE_ELEMENT_SELECTOR: '[draggable]', }; // Constants