Merge pull request #33 from bronley/fix-unable-to-delete-unread-conversation

Fix: unable to delete unread conversation
This commit is contained in:
qcrao
2025-03-05 15:18:36 +08:00
committed by GitHub
3 changed files with 20 additions and 10 deletions

View File

@@ -49,7 +49,19 @@ async function archiveConversation(checkbox) {
}); });
console.log("1. Hovering over conversation...", conversationElement); console.log("1. Hovering over conversation...", conversationElement);
conversationElement.dispatchEvent(hoverEvent);
const interactiveElement = conversationElement.querySelector("[draggable=\"true\"]");
if (!interactiveElement) {
console.log("Skipping conversation - no interactive elements found");
// Show notification to user
const title =
conversationElement.querySelector(Selectors.TITLE_SELECTOR)
?.textContent || "this conversation";
alert(`Unable to archive the conversation: "${title}".`);
return false;
}
interactiveElement.dispatchEvent(hoverEvent);
await delay(200); await delay(200);
const pointerDownEvent = new PointerEvent("pointerdown", { const pointerDownEvent = new PointerEvent("pointerdown", {

View File

@@ -62,17 +62,15 @@ async function deleteConversation(checkbox) {
console.log("conversationElement", conversationElement); console.log("conversationElement", conversationElement);
// Look for hoverable element within the conversation element // Look for interactive element within the conversation element
const hoverableDiv = conversationElement.querySelector( const interactiveElement = conversationElement.querySelector("[draggable=\"true\"]");
"div.can-hover\\:group-hover\\:visible" if (!interactiveElement) {
); console.log("Skipping conversation - no interactive elements found");
if (!hoverableDiv) {
console.log("Skipping conversation - no hoverable element found");
// Show notification to user // Show notification to user
const title = const title =
conversationElement.querySelector(Selectors.TITLE_SELECTOR) conversationElement.querySelector(Selectors.TITLE_SELECTOR)
?.textContent || "this conversation"; ?.textContent || "this conversation";
alert(`Unable to delete unread conversation: "${title}".`); alert(`Unable to delete the conversation: "${title}".`);
return false; return false;
} }
@@ -83,7 +81,7 @@ async function deleteConversation(checkbox) {
}); });
console.log("1. Hovering over conversation...", conversationElement); console.log("1. Hovering over conversation...", conversationElement);
conversationElement.dispatchEvent(hoverEvent); interactiveElement.dispatchEvent(hoverEvent);
await delay(200); await delay(200);
// Try to find the three dot button // Try to find the three dot button

View File

@@ -1,7 +1,7 @@
{ {
"manifest_version": 3, "manifest_version": 3,
"name": "ChatGPT Bulk Delete", "name": "ChatGPT Bulk Delete",
"version": "5.8", "version": "5.9",
"description": "A Chrome extension to bulk delete ChatGPT conversations", "description": "A Chrome extension to bulk delete ChatGPT conversations",
"icons": { "icons": {
"48": "icon48.png" "48": "icon48.png"