PageSourceSearch

https://www.vvspartanijkerk.nl/wp-content/plugins/draad-connect-2.8.1/assets/js/ai-beacon.js

js vvspartanijkerk.nl collected 2026-10-02 22:08:00 UTC 1,638 bytes, 58 lines download raw bytes

1/**
2 * Draad Connect — AI-referral beacon.
3 *
4 * Werkt door full-page caches (WP Rocket, Cloudflare) heen: draait client-side,
5 * dus onafhankelijk van template_redirect. Stuurt alleen bij een AI-referrer,
6 * eenmaal per pageload. De server (her)classificeert en telt.
7 */
8(function () {
9    'use strict';
10
11    var cfg = window.DraadAIBeacon;
12    if (!cfg || !cfg.endpoint || !cfg.hosts || !cfg.hosts.length) {
13        return;
14    }
15    if (!document.referrer) {
16        return;
17    }
18
19    var refHost;
20    try {
21        refHost = new URL(document.referrer).hostname.toLowerCase();
22    } catch (e) {
23        return;
24    }
25    if (!refHost || refHost === location.hostname.toLowerCase()) {
26        return;
27    }
28
29    // Exacte host of subdomein daarvan (zelfde regel als classify_referrer server-side).
30    var isAi = cfg.hosts.some(function (host) {
31        host = String(host).toLowerCase();
32        return refHost === host || refHost.slice(-(host.length + 1)) === ('.' + host);
33    });
34    if (!isAi) {
35        return;
36    }
37
38    var payload = JSON.stringify({
39        referrer: document.referrer,
40        path: location.pathname
41    });
42
43    try {
44        if (navigator.sendBeacon) {
45            navigator.sendBeacon(cfg.endpoint, new Blob([payload], { type: 'application/json' }));
46        } else {
47            fetch(cfg.endpoint, {
48                method: 'POST',
49                headers: { 'Content-Type': 'application/json' },
50                body: payload,
51                keepalive: true,
52                credentials: 'omit'
53            });
54        }
55    } catch (e) {
56        // Beacon mag de pagina nooit breken.
57    }
58})();

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.