From 6bd048b8fb27f92b4c89b1f01bd977f4ccca7b5a Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Tue, 10 Dec 2024 17:19:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJyMethod.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJyMethod.js | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/SrcJyMethod.js b/SrcJyMethod.js index 7062b92f..d0c2a599 100644 --- a/SrcJyMethod.js +++ b/SrcJyMethod.js @@ -19,28 +19,20 @@ function extraJS(playUrl) { function click2() { return $.toString(() => { function check() { - try { - // 获取所有具有 id 属性的元素 - var elementsWithId2 = Array.from(document.querySelectorAll('[id]')); - fba.log("" + elementsWithId2.length); - if(elementsWithId2.length>0){ - fba.log(elementsWithId2[0].outerHTML); - fba.log(elementsWithId2[1].outerHTML); - fba.log(elementsWithId2[2].outerHTML); - fba.log(elementsWithId2[3].outerHTML); - } - setTimeout(check, 100); - //var elementsWithId = document.querySelectorAll('[id]'); - // 遍历每个元素,检查文本内容并触发点击事件 - elementsWithId2.forEach(element => { + var is = 0; + // 获取所有具有 id 属性的元素 + var elementsWithId = Array.from(document.querySelectorAll('[id]')); + // 遍历每个元素,检查文本内容并触发点击事件 + elementsWithId.forEach(element => { + // 检查元素的文本内容是否包含 "点击播放" + if (element.outerHTML.includes("播放")) { fba.log(element.outerHTML); - // 检查元素的文本内容是否包含 "点击播放" - if (element.textContent.includes("播放")) { - fba.log("点击"); - element.click(); - } - }); - } catch (e) { + fba.log("点击"); + element.click(); + is = 1; + } + }); + if(is==0){ setTimeout(check, 100); } }