From 636b0323075225c584b62719ed51e75521bb7ffb Mon Sep 17 00:00:00 2001 From: aura Date: Tue, 17 Feb 2026 22:39:42 +0100 Subject: push source --- backend/instance/nocookies/data/js/embeds.js | 89 ++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 backend/instance/nocookies/data/js/embeds.js (limited to 'backend/instance/nocookies/data/js/embeds.js') diff --git a/backend/instance/nocookies/data/js/embeds.js b/backend/instance/nocookies/data/js/embeds.js new file mode 100644 index 0000000..dfe4899 --- /dev/null +++ b/backend/instance/nocookies/data/js/embeds.js @@ -0,0 +1,89 @@ +(function() { + const classname = Math.random().toString(36).replace(/[^a-z]+/g, ''); + + var l = document.location, + is_audioboom = false, + is_dailymotion = false, + is_dailybuzz = false, + is_playerclipslaliga = false; + + switch (l.hostname) { + + case 'embeds.audioboom.com': + is_audioboom = true; + break; + + case 'dailymotion.com': + case 'www.dailymotion.com': + is_dailymotion = l.pathname.indexOf('/embed') === 0; + break; + + case 'geo.dailymotion.com': + is_dailymotion = l.pathname.indexOf('/player') === 0; + break; + + case 'dailybuzz.nl': + is_dailybuzz = l.pathname.indexOf('/buzz/embed') === 0; + break; + + case 'playerclipslaliga.tv': + is_playerclipslaliga = true; + break; + } + + + function searchEmbeds() { + setTimeout(function() { + + // audioboom.com iframe embeds + if (is_audioboom) { + document.querySelectorAll('div[id^="cookie-modal"] .modal[style*="block"] .btn.mrs:not(.' + classname + ')').forEach(function(button) { + button.className += ' ' + classname; + button.click(); + }); + } + + // dailymotion.com iframe embeds + else if (is_dailymotion) { + document.querySelectorAll('.np_DialogConsent-accept:not(.' + classname + '), .consent_screen-accept:not(.' + classname + ')').forEach(function(button) { + button.className += ' ' + classname; + button.click(); + }); + } + + // dailybuzz.nl iframe embeds + else if (is_dailybuzz) { + document.querySelectorAll('#ask-consent #accept:not(.' + classname + ')').forEach(function(button) { + button.className += ' ' + classname; + button.click(); + }); + } + + // playerclipslaliga.tv iframe embeds + else if (is_playerclipslaliga) { + document.querySelectorAll('#cookies button[onclick*="saveCookiesSelection"]:not(.' + classname + ')').forEach(function(button) { + button.className += ' ' + classname; + button.click(); + }); + } + + // Give up + else { + return; + } + + searchEmbeds(); + }, 1000); + } + + var start = setInterval(function() { + var html = document.querySelector('html'); + + if (!html || (new RegExp(classname)).test(html.className)) + return; + + html.className += ' ' + classname; + searchEmbeds(); + clearInterval(start); + }, 500); +})(); \ No newline at end of file -- cgit v1.2.3