update xpath
This commit is contained in:
parent
d20ac8d6ce
commit
b6d6a6dd79
File diff suppressed because one or more lines are too long
|
|
@ -266,26 +266,18 @@ export class ContentService {
|
|||
element.dispatchEvent(event);
|
||||
}
|
||||
|
||||
private _clickIfExists(xpath: string): Promise<boolean> {
|
||||
private _clickIfExists(selector: string): Promise<boolean> {
|
||||
return new Promise((resolve) => {
|
||||
const result = document.evaluate(
|
||||
xpath,
|
||||
document,
|
||||
null,
|
||||
XPathResult.FIRST_ORDERED_NODE_TYPE,
|
||||
null
|
||||
);
|
||||
|
||||
const element = result.singleNodeValue as HTMLElement | null;
|
||||
const element = document.querySelector(selector);
|
||||
|
||||
if (element) {
|
||||
element.scrollIntoView({ behavior: "auto", block: "center" });
|
||||
setTimeout(() => {
|
||||
element.click();
|
||||
(element as any)?.click();
|
||||
resolve(true);
|
||||
}, 100); // Đợi scroll một chút rồi click
|
||||
} else {
|
||||
console.warn("Không tìm thấy phần tử:", xpath);
|
||||
console.warn("Không tìm thấy phần tử:", selector);
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export class TeamsChatService {
|
|||
root_id: '[aria-selected="true"] [id^="chat-list-item"]',
|
||||
room_name: '[data-tid="chat-title"]',
|
||||
close_reply_btn:
|
||||
"/html/body/div[1]/div/div/div/div[6]/div[4]/div/div[1]/div/div[3]/div/div[3]/div/div[2]/div/div[2]/div/div/card/div/div/div[2]/div/div[1]/button",
|
||||
'[data-track-action-scenario="messageQuotedReplyDismissed"]',
|
||||
reply_btn: '[aria-label="Reply"]',
|
||||
chat_input:
|
||||
// "/html/body/div[1]/div/div/div/div[6]/div[4]/div/div[1]/div/div[3]/div/div[3]/div/div[2]/div/div[2]/div[1]/div",
|
||||
|
|
|
|||
Loading…
Reference in New Issue