kill ads loop after 10s

This commit is contained in:
Jai A 2024-11-03 23:50:55 -07:00
parent db145cd8ad
commit d3a7bf967e
No known key found for this signature in database
GPG Key ID: 9A9F9B7250E9883C

View File

@ -107,13 +107,17 @@
}); });
}); });
let attempts = 0;
function syncAgreeState() { function syncAgreeState() {
const primaryButton = document.querySelector('[mode="primary"]'); const primaryButton = document.querySelector('[mode="primary"]');
if (primaryButton) { if (primaryButton) {
primaryButton.click(); primaryButton.click();
} else { } else {
setTimeout(syncAgreeState, 100); attempts++;
if (attempts < 10) {
setTimeout(syncAgreeState, 1000);
}
} }
} }
syncAgreeState(); syncAgreeState();