PageSourceSearch

https://catholicsay.com/wp-content/plugins/catholicsay-ads/templates/fgads-front.js?ver=2.0.4

js catholicsay.com collected 2026-10-02 13:35:15 UTC 2,271 bytes, 71 lines download raw bytes

1(function(){
2    'use strict';
3
4    var D = window.fgadsData || {};
5
6    /* -- Impression tracking via IntersectionObserver ------ */
7    var tracked = {};
8
9    function trackImpression(card) {
10        var adId    = card.getAttribute('data-ad-id');
11        var section = card.getAttribute('data-section') || '';
12        if (!adId || tracked[adId]) return;
13        tracked[adId] = true;
14
15        var fd = new FormData();
16        fd.append('action', 'fgads_impression');
17        fd.append('nonce', D.nonce || '');
18        fd.append('ad_id', adId);
19        fd.append('page_url', window.location.href);
20        fd.append('section', section);
21
22        fetch(D.ajaxUrl || '/wp-admin/admin-ajax.php', {
23            method: 'POST',
24            body: fd,
25            credentials: 'same-origin'
26        }).catch(function(){});
27    }
28
29    var observer = null;
30    if ('IntersectionObserver' in window) {
31        observer = new IntersectionObserver(function(entries){
32            entries.forEach(function(entry){
33                if (entry.isIntersecting) {
34                    trackImpression(entry.target);
35                    observer.unobserve(entry.target);
36                }
37            });
38        }, { threshold: 0.5 });
39    }
40
41    function observeAds() {
42        if (!observer) return;
43        document.querySelectorAll('.fgads-card[data-ad-id]').forEach(function(card){
44            if (!tracked[card.getAttribute('data-ad-id')]) {
45                observer.observe(card);
46            }
47        });
48    }
49
50    /* -- Boot --------------------------------------------- */
51    function boot() {
52        /* Observe ads injected by the server-side footer script */
53        setTimeout(observeAds, 500);
54
55        /* Re-observe after any DOM changes (AJAX, filters, etc.) */
56        if (typeof MutationObserver !== 'undefined') {
57            var mo = new MutationObserver(function(mutations){
58                var hasNew = mutations.some(function(m){ return m.addedNodes.length > 0; });
59                if (hasNew) observeAds();
60            });
61            mo.observe(document.body, { childList: true, subtree: true });
62        }
63    }
64
65    if (document.readyState === 'loading') {
66        document.addEventListener('DOMContentLoaded', boot);
67    } else {
68        boot();
69    }
70
71})();

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.