opt can not found delete confirm button

This commit is contained in:
qcrao
2023-10-09 14:48:20 +08:00
parent 244a846b66
commit 2a598ec8e6
2 changed files with 4 additions and 1 deletions

View File

@@ -36,7 +36,9 @@ async function deleteConversation(checkbox) {
const deleteButton = await waitForElement("nav div a>div>button:nth-child(2)");
if (deleteButton) {
await delay(100);
console.log("2. 点击删除按钮");
deleteButton.click(); // 点击删除按钮
// 等待确认删除对话框的按钮出现
@@ -62,6 +64,7 @@ async function waitForElement(selector, timeout = 5000) {
if (element) return element;
await delay(100);
}
console.log('do not found delete confirm button')
throw new Error(`Element ${selector} not found within ${timeout}ms`);
}

View File

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