diff --git a/content.js b/content.js index 9c1b233..4179c28 100644 --- a/content.js +++ b/content.js @@ -7,16 +7,24 @@ function dismissPaywall() { const overlay = document.querySelector('.payok__wrap'); if (!overlay) return; - if (typeof window.Optanon?.AllowAll !== 'function') return; - console.log('[Buienradar Clicker] Dismissing paywall'); handled = true; clearInterval(pollInterval); observer.disconnect(); - window.Optanon.AllowAll(); - document.body.style.overflow = ''; - overlay.remove(); + const script = document.createElement('script'); + script.textContent = ` + (function() { + var w = document.querySelector('.payok__wrap'); + if (w && window.Optanon && typeof window.Optanon.AllowAll === 'function') { + window.Optanon.AllowAll(); + document.body.style.overflow = ''; + w.remove(); + } + })(); + `; + document.body.appendChild(script); + script.remove(); } const observer = new MutationObserver(dismissPaywall);