| (function() {
|
| 'use strict';
|
|
|
| const rejectSelectors = [
|
| '[id*="reject"]', '[class*="reject"]',
|
| '[id*="decline"]', '[class*="decline"]',
|
| 'button[aria-label*="Reject"]', 'button[aria-label*="reject"]',
|
| '#onetrust-reject-all-handler',
|
| '.js-cookie-decline',
|
| '[data-testid="cookie-policy-dialog-reject-button"]',
|
| '[class*="cookie"] [class*="reject"]',
|
| '[class*="consent"] [class*="reject"]',
|
| '[id*="consent"] button[class*="secondary"]',
|
| '.fc-cta-do-not-consent',
|
| '#CybotCookiebotDialogBodyButtonDecline',
|
| '[class*="CookieConsent"] button:last-child',
|
| ];
|
|
|
| const bannerSelectors = [
|
| '[class*="cookie-banner"]', '[class*="cookie-notice"]',
|
| '[class*="consent-banner"]', '[class*="consent-modal"]',
|
| '[id*="cookie-banner"]', '[id*="cookie-notice"]',
|
| '#onetrust-banner-sdk', '.fc-consent-root',
|
| '#CybotCookiebotDialog', '[class*="CookieConsent"]',
|
| '[class*="gdpr"]', '[id*="gdpr"]',
|
| ];
|
|
|
| function clickReject() {
|
| for (const selector of rejectSelectors) {
|
| const btn = document.querySelector(selector);
|
| if (btn && btn.offsetParent !== null) {
|
| btn.click();
|
| return true;
|
| }
|
| }
|
| return false;
|
| }
|
|
|
| function hideBanners() {
|
| for (const selector of bannerSelectors) {
|
| const el = document.querySelector(selector);
|
| if (el && el.offsetParent !== null) {
|
| el.style.display = 'none';
|
| }
|
| }
|
| }
|
|
|
| function attempt() {
|
| if (clickReject()) return true;
|
| hideBanners();
|
| return false;
|
| }
|
|
|
|
|
| if (!attempt()) {
|
|
|
| const obs = new MutationObserver(() => {
|
| if (attempt()) obs.disconnect();
|
| });
|
| if (document.body) {
|
| obs.observe(document.body, { childList: true, subtree: true });
|
| } else {
|
| document.addEventListener('DOMContentLoaded', () => {
|
| if (!attempt()) {
|
| obs.observe(document.body, { childList: true, subtree: true });
|
| }
|
| });
|
| }
|
|
|
| setTimeout(() => { attempt(); obs.disconnect(); }, 8000);
|
| }
|
| })();
|
|
|