From 9e4c860f968b337267857e4a483651516986fe53 Mon Sep 17 00:00:00 2001 From: nearz Date: Wed, 28 May 2025 20:13:04 -0400 Subject: [PATCH 1/2] fixed selectors for changes in ChatGPT UI --- globals.js | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/globals.js b/globals.js index fe21aec..32073a7 100644 --- a/globals.js +++ b/globals.js @@ -9,10 +9,10 @@ if (typeof window.globalsLoaded === "undefined") { confirmDeleteButton: "button.btn.btn-danger", threeDotButton: '[id^="radix-"]', // 更新为新的对话选择器格式 - CONVERSATION_SELECTOR: 'li[data-testid^="history-item-"]', + CONVERSATION_SELECTOR: '[href^="/c/"]', // 更新标题选择器,保持相对路径 TITLE_SELECTOR: ".relative.grow.overflow-hidden.whitespace-nowrap", - INTERACTIVE_ELEMENT_SELECTOR: '[draggable]', + INTERACTIVE_ELEMENT_SELECTOR: "button", }; // Constants diff --git a/manifest.json b/manifest.json index 64bcae7..b802ae6 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "ChatGPT Bulk Delete", - "version": "5.10", + "version": "5.11", "description": "A Chrome extension to bulk delete ChatGPT conversations", "icons": { "48": "icon48.png" From 83d541841da20161e20721047ef541073e1ae77b Mon Sep 17 00:00:00 2001 From: nearz Date: Thu, 29 May 2025 14:02:26 -0400 Subject: [PATCH 2/2] remove min-height, add history selector, change chat selector to link node --- addCheckboxes.js | 5 +++-- globals.js | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/addCheckboxes.js b/addCheckboxes.js index ac0c153..dc3614d 100644 --- a/addCheckboxes.js +++ b/addCheckboxes.js @@ -73,7 +73,9 @@ function addShiftKeyEventListeners() { // 添加复选框到每个对话 function addCheckboxes() { console.log("Adding checkboxes to conversations...", Selectors); - const conversations = document.querySelectorAll( + //Select history div which contains all regular chats + const history = document.querySelector(Selectors.HISTORY); + const conversations = history.querySelectorAll( Selectors.CONVERSATION_SELECTOR ); @@ -93,7 +95,6 @@ function addCheckboxes() { align-items: center; width: 100%; padding: 0; - min-height: inherit; `; // 创建新的复选框并添加到 flexContainer diff --git a/globals.js b/globals.js index 32073a7..3a72750 100644 --- a/globals.js +++ b/globals.js @@ -8,8 +8,11 @@ if (typeof window.globalsLoaded === "undefined") { conversationsCheckbox: ".conversation-checkbox:checked", confirmDeleteButton: "button.btn.btn-danger", threeDotButton: '[id^="radix-"]', + //Select history div that contains all chats + HISTORY: '[id^="history"]', // 更新为新的对话选择器格式 - CONVERSATION_SELECTOR: '[href^="/c/"]', + // Updated Converstation selector changed to link nodes + CONVERSATION_SELECTOR: "a", // 更新标题选择器,保持相对路径 TITLE_SELECTOR: ".relative.grow.overflow-hidden.whitespace-nowrap", INTERACTIVE_ELEMENT_SELECTOR: "button",