From c31fb3d61702bb6ad6930ea946a2cb96ff921d99 Mon Sep 17 00:00:00 2001 From: Eddy de Vink Date: Wed, 20 May 2026 04:39:00 +0200 Subject: [PATCH] fix: call AllowAll directly instead of clicking UI elements --- content.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/content.js b/content.js index 9a155aa..9c1b233 100644 --- a/content.js +++ b/content.js @@ -2,26 +2,26 @@ console.log('[Buienradar Clicker] Content script loaded'); let handled = false; -function handleOverlay() { +function dismissPaywall() { 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; + if (typeof window.Optanon?.AllowAll !== 'function') return; - console.log('[Buienradar Clicker] Overlay found, clicking free option'); + console.log('[Buienradar Clicker] Dismissing paywall'); handled = true; clearInterval(pollInterval); observer.disconnect(); - freeRadio.click(); - setTimeout(() => submitBtn.click(), 100); + + window.Optanon.AllowAll(); + document.body.style.overflow = ''; + overlay.remove(); } -const observer = new MutationObserver(handleOverlay); +const observer = new MutationObserver(dismissPaywall); observer.observe(document.body, { childList: true, subtree: true }); -const pollInterval = setInterval(handleOverlay, 500); +const pollInterval = setInterval(dismissPaywall, 500); -handleOverlay(); +dismissPaywall();