chrome-buienradar-clicker/content.js

27 lines
700 B
JavaScript

console.log('[Buienradar Clicker] Content script loaded');
let handled = false;
function dismissPaywall() {
if (handled) return;
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 observer = new MutationObserver(dismissPaywall);
observer.observe(document.body, { childList: true, subtree: true });
const pollInterval = setInterval(dismissPaywall, 500);
dismissPaywall();