【发布时间】:2021-08-29 16:44:46
【问题描述】:
我如何实现一个休息时间,在我设定的时间间隔内为每个循环执行 resa() 函数之前需要一点时间。 尝试使用 setTimeout 但它继续; :(
var checkInterval = setInterval(() => {
if (document.documentElement.innerText.includes('TikTok') == true){
clearInterval(checkInterval ) //To stop the loop
var checkInterval2 = setInterval(function () {
résa()
if (document.documentElement.innerText.includes('Cancel') == true){
clearInterval(checkInterval2 )
}
}, 1000);
};
}, 200);
【问题讨论】:
标签: javascript google-chrome google-chrome-extension sleep