1/** 2 * IMKBY Stats Tracker v1.1 3 * Î£Ï Î»Î»Îγει ανÏÎ½Ï Î¼Î± ÏÏαÏιÏÏικά ÎÎÎÎ ÏÏαγμαÏικÏν εÏιÏκεÏÏÏν. 4 * Îεν ÏÏηÏιμοÏοιεί cookies για ÏαÏακολοÏθηÏη. localStorage για visitor_hash. 5 */ 6(function() { 7 'use strict'; 8 9 // Find own script tag to get collect endpoint 10 var script = document.currentScript; 11 if (!script) { 12 var scripts = document.getElementsByTagName('script'); 13 for (var i = scripts.length - 1; i >= 0; i--) { 14 if (scripts[i].src && scripts[i].src.indexOf('tracker.js') !== -1) { 15 script = scripts[i]; 16 break; 17 } 18 } 19 } 20 if (!script) return; 21 22 var collectUrl = script.getAttribute('data-collect'); 23 if (!collectUrl) { 24 collectUrl = script.src.replace(/tracker\.js.*/, 'collect.php'); 25 } 26 27 // Don't track admin / preview pages 28 if (location.pathname.indexOf('/administrator') !== -1) return; 29 if (location.search.indexOf('tmpl=component') !== -1) return; 30 31 // ===== ΡομÏÏÏ & Î±Ï ÏομαÏιÏμοί: δεν ÏÏÎÎ»Î½Î¿Ï Î½ ÏίÏοÏα ===== 32 var nav = navigator, ua = nav.userAgent || ''; 33 if (nav.webdriver) return; 34 if (!(nav.languages && nav.languages.length)) return; 35 if (/bot|crawl|spider|slurp|search|fetch|monitor|preview|headless|phantom|selenium|playwright|puppeteer|lighthouse|pagespeed|gtmetrix|pingdom|electron/i.test(ua)) return; 36 37 // ΠδιαÏειÏιÏÏÎ®Ï (άνοιξε Ïα ÏÏαÏιÏÏικά Ïε Î±Ï ÏÏν Ïον ÏÏ Î»Î»Î¿Î¼ÎµÏÏηÏή) δεν μεÏÏάει 38 if (/(?:^|; )imkbyx=1/.test(document.cookie)) return; 39 40 // ===== Visitor identification ===== 41 var visitorHash; 42 try { 43 visitorHash = localStorage.getItem('_uss_v'); 44 if (!visitorHash) { 45 visitorHash = generateHash(); 46 localStorage.setItem('_uss_v', visitorHash); 47 } 48 } catch (e) { 49 visitorHash = generateHash(); 50 } 51 52 var sessionHash; 53 try { 54 sessionHash = sessionStorage.getItem('_uss_s'); 55 if (!sessionHash) { 56 sessionHash = generateHash(); 57 sessionStorage.setItem('_uss_s', sessionHash); 58 } 59 } catch (e) { 60 sessionHash = generateHash(); 61 } 62 63 var isNew = 1; 64 try { isNew = localStorage.getItem('_uss_returning') ? 0 : 1; } catch (e) {} 65 66 function generateHash() { 67 var s = ''; 68 var chars = 'abcdef0123456789'; 69 for (var i = 0; i < 32; i++) { 70 s += chars[Math.floor(Math.random() * chars.length)]; 71 } 72 return s + Date.now().toString(16); 73 } 74 75 // ===== Browser & device detection ===== 76 function detectBrowser() { 77 var b = { name: 'Unknown', version: '' }; 78 if (/Edg\//.test(ua)) { b.name = 'Edge'; b.version = (ua.match(/Edg\/([\d.]+)/) || [])[1] || ''; } 79 else if (/OPR\//.test(ua)) { b.name = 'Opera'; b.version = (ua.match(/OPR\/([\d.]+)/) || [])[1] || ''; } 80 else if (/Chrome\//.test(ua)) { b.name = 'Chrome'; b.version = (ua.match(/Chrome\/([\d.]+)/) || [])[1] || ''; } 81 else if (/Safari\//.test(ua)) { b.name = 'Safari'; b.version = (ua.match(/Version\/([\d.]+)/) || [])[1] || ''; } 82 else if (/Firefox\//.test(ua)) { b.name = 'Firefox'; b.version = (ua.match(/Firefox\/([\d.]+)/) || [])[1] || ''; } 83 return b; 84 } 85 86 function detectOS() { 87 if (/Windows NT 10/.test(ua)) return 'Windows 10/11'; 88 if (/Windows NT 6\.3/.test(ua)) return 'Windows 8.1'; 89 if (/Windows NT 6\.2/.test(ua)) return 'Windows 8'; 90 if (/Windows NT 6\.1/.test(ua)) return 'Windows 7'; 91 if (/Windows/.test(ua)) return 'Windows'; 92 if (/iPhone|iPad/.test(ua)) return 'iOS'; 93 if (/Macintosh|Mac OS/.test(ua)) return 'macOS'; 94 if (/Android/.test(ua)) return 'Android'; 95 if (/Linux/.test(ua)) return 'Linux'; 96 return 'Unknown'; 97 } 98 99 function detectDevice() { 100 if (/Mobile|iPhone|iPod/.test(ua)) return 'mobile'; 101 if (/Tablet|iPad/.test(ua)) return 'tablet'; 102 return 'desktop'; 103 } 104 105 var browser = detectBrowser(); 106 107 var payload = { 108 visitor_hash: visitorHash, 109 session_hash: sessionHash, 110 url: location.href, 111 path: location.pathname, 112 query: location.search.substring(0, 500), 113 referrer: document.referrer.substring(0, 500), 114 browser: browser.name, 115 browser_version: browser.version.substring(0, 30), 116 os: detectOS(), 117 device_type: detectDevice(), 118 screen_w: screen.width, 119 screen_h: screen.height, 120 viewport_w: window.innerWidth, 121 viewport_h: window.innerHeight, 122 language: nav.language || '', 123 tz: (function() { try { return Intl.DateTimeFormat().resolvedOptions().timeZone || ''; } catch (e) { return ''; } })(), 124 is_new_visitor: isNew, 125 timestamp: Date.now() 126 }; 127 128 // ===== Send beacon (ίδια ÏÏοÎÎ»ÎµÏ Ïη, POST) ===== 129 function send(data) { 130 var json = JSON.stringify(data); 131 if (nav.sendBeacon) { 132 try { 133 if (nav.sendBeacon(collectUrl, new Blob([json], { type: 'text/plain' }
133))) return; 134 } catch (e) {} 135 } 136 if (window.fetch) { 137 try { 138 fetch(collectUrl, { 139 method: 'POST', 140 headers: { 'Content-Type': 'text/plain' }, 141 body: json, 142 keepalive: true, 143 credentials: 'same-origin' 144 }).catch(function() {}); 145 } catch (e) {} 146 } 147 } 148 149 var pageStart = Date.now(); 150 var sent = false, finished = false; 151 var events = ['pointermove', 'pointerdown', 'touchstart', 'scroll', 'wheel', 'keydown']; 152 153 // ΠεÏίÏκεÏη γÏάÏεÏαι μÏνο με Ïην ÏÏÏÏη ανθÏÏÏινη κίνηÏη 154 function human() { 155 if (sent || document.visibilityState === 'hidden') return; 156 // ÎιαÏÏάÏÎµÎ¹Ï Ïη ÏÏιγμή ÏÎ·Ï ÎºÎ¯Î½Î·ÏÎ·Ï (ÏÏο ÏÏÏÏÏμα μÏοÏεί να είναι ακÏμη 0, Ï.Ï. καÏÏÎλα ÏÏο ÏαÏαÏκήνιο) 157 if (!screen.width || !window.innerWidth) return; 158 payload.screen_w = screen.width; payload.screen_h = screen.height; 159 payload.viewport_w = window.innerWidth; payload.viewport_h = window.innerHeight; 160 sent = true; 161 events.forEach(function(e) { window.removeEventListener(e, human, true); }); 162 try { localStorage.setItem('_uss_returning', '1'); } catch (e) {} 163 send(payload); 164 165 var searchQuery = ''; 166 try { 167 var params = new URLSearchParams(location.search); 168 ['searchword', 'q', 'search', 's', 'query'].forEach(function(key) { 169 if (params.get(key)) searchQuery = params.get(key); 170 }); 171 } catch (e) {} 172 if (searchQuery) { 173 send({ 174 type: 'search', 175 query: searchQuery.substring(0, 200), 176 path: location.pathname, 177 visitor_hash: visitorHash, 178 session_hash: sessionHash 179 }); 180 } 181 } 182 events.forEach(function(e) { window.addEventListener(e, human, { capture: true, passive: true }); }); 183 184 // ΣÏο κλείÏιμο: ÎÎÎΠη διάÏκεια, μία ÏοÏά, ÏÏην ίδια εγγÏαÏή 185 function finish() { 186 if (!sent || finished) return; 187 finished = true; 188 send({ 189 type: 'duration', 190 path: location.pathname, 191 session_hash: sessionHash, 192 duration_ms: Date.now() - pageStart 193 }); 194 } 195 window.addEventListener('pagehide', finish); 196 window.addEventListener('beforeunload', finish); 197})();
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.