update
This commit is contained in:
parent
478def8447
commit
327f2cb1cf
@ -483,3 +483,20 @@ window.config = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function waitForElement(selector, maxAttempts = 20, interval = 25) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
let attempts = 0;
|
||||||
|
|
||||||
|
const checkForElement = setInterval(() => {
|
||||||
|
const element = document.querySelector(selector);
|
||||||
|
|
||||||
|
if (element || attempts >= maxAttempts) {
|
||||||
|
clearInterval(checkForElement);
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
|
||||||
|
attempts++;
|
||||||
|
}, interval);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user