replace click with hover
This commit is contained in:
@@ -27,9 +27,22 @@ function removeAllCheckboxes() {
|
||||
|
||||
async function deleteConversation(checkbox) {
|
||||
const conversationElement = checkbox.parentElement;
|
||||
await delay(300);
|
||||
console.log("1. Clicking conversation...", conversationElement);
|
||||
conversationElement.click();
|
||||
await delay(100);
|
||||
// console.log("1. Clicking conversation...", conversationElement);
|
||||
// conversationElement.click();
|
||||
// 将 click 替换为悬停
|
||||
|
||||
// 创建一个鼠标悬停事件
|
||||
const hoverEvent = new MouseEvent('mouseover', {
|
||||
view: window,
|
||||
bubbles: true,
|
||||
cancelable: true
|
||||
});
|
||||
|
||||
console.log("1. Hovering over conversation...", conversationElement);
|
||||
// 触发鼠标悬停事件
|
||||
conversationElement.dispatchEvent(hoverEvent);
|
||||
await delay(200);
|
||||
|
||||
const pointerDownEvent = new PointerEvent('pointerdown', {
|
||||
bubbles: true,
|
||||
|
||||
Reference in New Issue
Block a user