PageSourceSearch

https://www.proson.gr/themes/custom/proson/js/cmp.js?v4

js proson.gr collected 2026-10-02 04:26:58 UTC 6,091 bytes, 214 lines download raw bytes

1(function() {
2  var host = 'proson.gr';
3  var element = document.createElement('script');
4  var firstScript = document.getElementsByTagName('script')[0];
5  var url = 'https://cmp.inmobi.com'
6    .concat('/choice/', 'nZNe13N2v0dnM', '/', host, '/choice.js?tag_version=V3');
7  var uspTries = 0;
8  var uspTriesLimit = 3;
9  element.async = true;
10  element.type = 'text/javascript';
11  element.src = url;
12
13  firstScript.parentNode.insertBefore(element, firstScript);
14
15  function makeStub() {
16    var TCF_LOCATOR_NAME = '__tcfapiLocator';
17    var queue = [];
18    var win = window;
19    var cmpFrame;
20
21    function addFrame() {
22      var doc = win.document;
23      var otherCMP = !!(win.frames[TCF_LOCATOR_NAME]);
24
25      if (!otherCMP) {
26        if (doc.body) {
27          var iframe = doc.createElement('iframe');
28
29          iframe.style.cssText = 'display:none';
30          iframe.name = TCF_LOCATOR_NAME;
31          doc.body.appendChild(iframe);
32        } else {
33          setTimeout(addFrame, 5);
34        }
35      }
36      return !otherCMP;
37    }
38
39    function tcfAPIHandler() {
40      var gdprApplies;
41      var args = arguments;
42
43      if (!args.length) {
44        return queue;
45      } else if (args[0] === 'setGdprApplies') {
46        if (
47          args.length > 3 &&
48          args[2] === 2 &&
49          typeof args[3] === 'boolean'
50        ) {
51          gdprApplies = args[3];
52          if (typeof args[2] === 'function') {
53            args[2]('set', true);
54          }
55        }
56      } else if (args[0] === 'ping') {
57        var retr = {
58          gdprApplies: gdprApplies,
59          cmpLoaded: false,
60          cmpStatus: 'stub'
61        };
62
63        if (typeof args[2] === 'function') {
64          args[2](retr);
65        }
66      } else {
67        if(args[0] === 'init' && typeof args[3] === 'object') {
68          args[3] = Object.assign(args[3], { tag_version: 'V3' });
69        }
70        queue.push(args);
71      }
72    }
73
74    function postMessageEventHandler(event) {
75      var msgIsString = typeof event.data === 'string';
76      var json = {};
77
78      try {
79        if (msgIsString) {
80          json = JSON.parse(event.data);
81        } else {
82          json = event.data;
83        }
84      } catch (ignore) {}
85
86      var payload = json.__tcfapiCall;
87
88      if (payload) {
89        window.__tcfapi(
90          payload.command,
91          payload.version,
92          function(retValue, success) {
93            var returnMsg = {
94              __tcfapiReturn: {
95                returnValue: retValue,
96                success: success,
97                callId: payload.callId
98              }
99            };
100            if (msgIsString) {
101              returnMsg = JSON.stringify(returnMsg);
102            }
103            if (event && event.source && event.source.postMessage) {
104              event.source.postMessage(returnMsg, '*');
105            }
106          },
107          payload.parameter
108        );
109      }
110    }
111
112    while (win) {
113      try {
114        if (win.frames[TCF_LOCATOR_NAME]) {
115          cmpFrame = win;
116          break;
117        }
118      } catch (ignore) {}
119
120      if (win === window.top) {
121        break;
122      }
123      win = win.parent;
124    }
125    if (!cmpFrame) {
126      addFrame();
127      win.__tcfapi = tcfAPIHandler;
128      win.addEventListener('message', postMessageEventHandler, false);
129    }
130  };
131
132  makeStub();
133
134  var uspStubFunction = function() {
135    var arg = arguments;
136    if (typeof window.__uspapi !== uspStubFunction) {
137      setTimeout(function() {
138        if (typeof window.__uspapi !== 'undefined') {
139          window.__uspapi.apply(window.__uspapi, arg);
140        }
141      }, 500);
142    }
143  };
144
145  var checkIfUspIsReady = function() {
146    uspTries++;
147    if (window.__uspapi === uspStubFunction && uspTries < uspTriesLimit) {
148      console.warn('USP is not accessible');
149    } else {
150      clearInterval(uspInterval);
151    }
152  };
153
154  if (typeof window.__uspapi === 'undefined') {
155    window.__uspapi = uspStubFunction;
156    var uspInterval = setInterval(checkIfUspIsReady, 6000);
157  }
158
159  __tcfapi('addEventListener', 2, function (tcData, success) {
160    if (success && (tcData.eventStatus === 'tcloaded' || tcData.eventStatus === 'useractioncomplete')) {
161      if (!tcData.gdprApplies) {
162        // Non-EU/UK Visitors
163        loadAds();
164      } else {
165        var hasPurposeOneConsent = tcData.purpose.consents['1'];
166        var hasGoogleConsent = false;
167        window.requestNonPersonalizedAds = 1;
168        if (hasPurposeOneConsent) {
169          if (tcData.vendor.consents['755'] && tcData.vendor.legitimateInterests['755']) {
170            if (
171              (tcData.purpose.consents['2'] || tcData.purpose.legitimateInterests['2']) &&
172              (tcData.purpose.consents['7'] || tcData.purpose.legitimateInterests['7']) &&
173              (tcData.purpose.consents['9'] || tcData.purpose.legitimateInterests['9']) &&
174              (tcData.purpose.consents['10'] || tcData.purpose.legitimateInterests['10'])
175            ) {
176              hasGoogleConsent = true;
177
178              if (
179                (tcData.purpose.consents['3'] || tcData.purpose.legitimateInterests['3']) &&
180                (tcData.purpose.consents['4'] || tcData.purpose.legitimateInterests['4'])
181              ) {
182                window.requestNonPersonalizedAds = 0;
183              }
184            }
185          }
186          if (hasGoogleConsent) {
187            loadAds();
188          }
189          if (hasGoogleConsent) {
190            gtag('consent', 'update', {
191              'ad_storage': 'granted',
192              'ad_user_data': 'granted',
193              'ad_personalization': 'granted',
194              'analytics_storage': 'granted',
195              'security_storage': 'granted'
196            });
197          } else  {
198            gtag('consent', 'update', {
199              'ad_storage': 'denied',
200              'ad_user_data': 'denied',
201              'ad_personalization': 'denied',
202              'analytics_storage': 'denied',
203              'security_storage': 'granted'
204            });
205            gtag('set', 'url_passthrough', true);
206            gtag('set', 'ads_data_redaction', true);
207          }
208        }
209
210      }
211    }
212  });
213
214})();

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.