PageSourceSearch

https://veja.abril.com.br/wp-content/plugins/abril-plugins/abril-a…/custom-fc.js?ver=0298283839390303

js abril.com.br collected 2026-09-24 06:43:27 UTC 3,862 bytes, 99 lines download raw bytes

1(function() {
2    function loadFundingChoicesScript() {
3      const script = document.createElement('script');
4      script.src = 'https://fundingchoicesmessages.google.com/i/pub-8032989188142109?ers=1';
5      script.async = true;
6      script.setAttribute('nonce', fcSettings.nonce);
7      document.head.appendChild(script);
8  
9      function signalGooglefcPresent() {
10        if (!window.frames['googlefcPresent']) {
11          if (document.body) {
12            const iframe = document.createElement('iframe');
13            iframe.style = 'width: 0; height: 0; border: none; z-index: -1000; left: -1000px; top: -1000px;';
14            iframe.style.display = 'none';
15            iframe.name = 'googlefcPresent';
16            document.body.appendChild(iframe);
17          } else {
18            setTimeout(signalGooglefcPresent, 0);
19          }
20        }
21      }
22      signalGooglefcPresent();
23    }
24
25    window.loadFundingChoicesScript = loadFundingChoicesScript;
26  
27    function onFirstScroll() {
28      window.removeEventListener('scroll', onFirstScroll);
29      if(fcSettings.displayMessage && (null === localStorage.getItem("abrilAssetsUser"))) {
30        loadFundingChoicesScript();
31      }
32      if(typeof wp_paywall_vars !== 'undefined' && !fcSettings.displayMessage && (null === localStorage.getItem("abrilAssetsUser"))){
33        if( (wp_paywall_vars.tipo_paywall === "opened") ){
34          loadFundingChoicesScript();
35        }
36      }
37    }
38  
39    window.addEventListener('scroll', onFirstScroll);
40  
41    window.__fcapi = window.__fcapi || [];
42    function displayFundingChoice() {
43        window.__fcapi.push(['showChoice', {
44            onConsent: function(consentData) {
45                console.log('User consent:', consentData);
46            },
47            onDismiss: function() {
48                console.log('Message dismissed');
49            }
50        }]);
51    }
52  
53    let viewEventTriggered = false;
54    window.addEventListener('load', function() {
55        if (window.__fcapi && typeof window.__fcapi.push === 'function') {
56            displayFundingChoice();
57        }
58
59        const observerfc = new MutationObserver(function(mutationsList, observer) {
60          for (let mutation of mutationsList) {
61              if (mutation.type === 'childList') {
62                  const fcRoot = document.querySelector('div.fc-ab-root');
63                  if (fcRoot && !viewEventTriggered) {
64
65                      // Evento GA4: view desbloqueio
66                      viewEventTriggered = true;
67                      gaSendEvent({
68                        category: 'adblocking_exibicao',
69                        hit_type: 'view',
70                      })
71
72                      const whitelistButton = fcRoot.querySelector('.fc-button-whitelist');
73                      const subscriptionLink = fcRoot.querySelector('.fc-subscription-link');
74                      if (whitelistButton) {
75                          whitelistButton.addEventListener('click', function() {
76                              // Evento GA4: click desbloqueio
77                              gaSendEvent({
78                                category: 'adblocking_desbloqueio',
79                                hit_type: 'click',
80                              })
81                          });
82                      }
83                      if (subscriptionLink) {
84                          subscriptionLink.addEventListener('click', function() {
85                              // Evento GA4: click oferta
86                              gaSendEvent({
87                                category: 'adblocking_oferta',
88                                hit_type: 'click',
89                              })
90                          });
91                      }
92                  }
93              }
94          }
95      });
96      observerfc.observe(document.body, { childList: true, subtree: true });
97
98    });
99  })();

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.