PageSourceSearch

https://www.footballtransfers.com/js/betting-consent.js?v=36965377930-203

js footballtransfers.com collected 2026-10-02 07:19:19 UTC 2,840 bytes, 67 lines download raw bytes

1/**
2 * Betting consent gate (FTDEV-71). Dutch edition only.
3 *
4 * Azerion's Dutch CMP design asks the visitor's age with two buttons, "Akkoord, ouder dan 24" and
5 * "Akkoord, jonger dan 24". The younger one withholds custom purpose c1 ("Betting toegestaan"),
6 * because Dutch gambling rules forbid aiming gambling advertising at under-24s.
7 *
8 * The OneCasino odds strip is gambling advertising: affiliate links plus a bookmaker logo. Blocking
9 * its impression pixel is not enough, the markup itself may not be shown. It is therefore hidden by
10 * CSS from the start and only revealed here, once c1 consent is actually present.
11 *
12 * Fails closed on purpose: no CMP, no answer yet, or a refused purpose all leave the strip hidden.
13 */
14(function () {
15    var ALLOWED_CLASS = 'ft-betting-allowed';
16    var BETTING_PURPOSE = 'c1';
17
18    function applyBettingConsent(isAllowed) {
19        document.body.classList.toggle(ALLOWED_CLASS, Boolean(isAllowed));
20
21        // The odds live in a <details> whose <summary> is the match row itself, so the row has to
22        // stay. Collapse the ones that render open by default, otherwise they leave a gap where the
23        // hidden strip used to be.
24        if (!isAllowed) {
25            document.querySelectorAll('details.match-odds[open]').forEach(function (details) {
26                details.removeAttribute('open');
27            });
28        }
29
30        // Let the ad server know as well, so Azerion can withhold gambling creatives from the same
31        // visitor. googletag is loaded by the mmcdn tag, which is itself consent-blocked, so it may
32        // legitimately not be there.
33        if (window.googletag && typeof window.googletag.cmd === 'object') {
34            window.googletag.cmd.push(function () {
35                if (window.googletag.pubads) {
36                    window.googletag.pubads().setTargeting('bettingAge', isAllowed ? 'true' : 'false');
37                }
38            });
39        }
40    }
41
42    function isBettingConsented(cmpData) {
43        return Boolean(cmpData && cmpData.purposeConsents && cmpData.purposeConsents[BETTING_PURPOSE]);
44    }
45
46    function readConsent() {
47        if (typeof window.__cmp !== 'function') {
48            applyBettingConsent(false);
49            return;
50        }
51
52        window.__cmp('getCMPData', null, function (cmpData, success) {
53            applyBettingConsent(success && isBettingConsented(cmpData));
54        });
55
56        // The visitor can change their mind through the settings screen, so keep following it.
57        window.__cmp('addEventListener', ['consent', function (cmpData) {
58            applyBettingConsent(isBettingConsented(cmpData));
59        }, false], null);
60    }
61
62    if (document.readyState === 'loading') {
63        document.addEventListener('DOMContentLoaded', readConsent);
64    } else {
65        readConsent();
66    }
67})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.