MCPcopy Create free account
hub / github.com/hoothin/UserScripts / clickEle

Function clickEle

Picviewer CE+/dist.user.js:27304–27317  ·  view source on GitHub ↗
(sel, failAction)

Source from the content-addressed store, hash-verified

27302 }
27303
27304 async function clickEle(sel, failAction) {
27305 await new Promise((resolve) => {
27306 let checkInv = setInterval(() => {
27307 let ele = document.querySelector(sel);
27308 if (ele) {
27309 clearInterval(checkInv);
27310 emuClick(ele);
27311 resolve();
27312 }else if(failAction) {
27313 failAction();
27314 }
27315 }, 100);
27316 });
27317 }
27318
27319 async function sleep(time) {
27320 await new Promise((resolve) => {

Callers 1

initFunction · 0.70

Calls 2

emuClickFunction · 0.70
resolveFunction · 0.70

Tested by

no test coverage detected