chrome-buienradar-clicker/content.js
2026-05-20 04:36:08 +02:00

27 lines
815 B
JavaScript

console.log('[Buienradar Clicker] Content script loaded');
let handled = false;
function handleOverlay() {
if (handled) return;
const overlay = document.querySelector('.payok__wrap');
if (!overlay) return;
const freeRadio = overlay.querySelector('input[name="pay-ok"][value="ok"]');
const submitBtn = overlay.querySelector('button.payok__submit');
if (!freeRadio || !submitBtn) return;
console.log('[Buienradar Clicker] Overlay found, clicking free option');
handled = true;
clearInterval(pollInterval);
observer.disconnect();
freeRadio.click();
setTimeout(() => submitBtn.click(), 100);
}
const observer = new MutationObserver(handleOverlay);
observer.observe(document.body, { childList: true, subtree: true });
const pollInterval = setInterval(handleOverlay, 500);
handleOverlay();