From 006d6dcab821b49c30f98d2653a065cb45a78e88 Mon Sep 17 00:00:00 2001 From: Eddy de Vink Date: Wed, 20 May 2026 04:31:49 +0200 Subject: [PATCH] fix: add polling fallback and debug logging --- content.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/content.js b/content.js index be4cc5f..ab6849e 100644 --- a/content.js +++ b/content.js @@ -1,6 +1,11 @@ if (!document.body) return; +console.log('[Buienradar Clicker] Content script loaded'); + +let handled = false; + function handleOverlay() { + if (handled) return; const overlay = document.querySelector('.payok__wrap'); if (!overlay) return; @@ -8,6 +13,9 @@ function handleOverlay() { 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); @@ -15,4 +23,7 @@ function handleOverlay() { const observer = new MutationObserver(handleOverlay); observer.observe(document.body, { childList: true, subtree: true }); + +const pollInterval = setInterval(handleOverlay, 500); + handleOverlay();