1// EAS tool-usage beacon â fires 'open' on load, 'download'/'launch' on link taps. 2// Usage: <script src="/eas-usage.js" data-tool="seo-score" defer></script> 3(function () { 4 var tool = (document.currentScript && document.currentScript.dataset.tool) || 'unknown'; 5 var ref = ''; 6 try { 7 ref = new URLSearchParams(location.search).get('ref') || sessionStorage.getItem('eas-ref') || ''; 8 if (ref) sessionStorage.setItem('eas-ref', ref); 9 } catch (e) {} 10 function send(action, detail) { 11 try { 12 var body = JSON.stringify({ tool: tool, action: action, detail: detail || '', page: location.pathname, ref: ref }); 13 if (navigator.sendBeacon) { navigator.sendBeacon('/eas-usage.php', new Blob([body], { type: 'application/json' })); } 14 else { fetch('/eas-usage.php', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: body, keepalive: true }); } 15 } catch (e) {} 16 } 17 send('open'); 18 document.addEventListener('click', function (e) { 19 var a = e.target && e.target.closest ? e.target.closest('a') : null; 20 if (!a) return; 21 var href = a.getAttribute('href') || ''; 22 if (/^\/eas-usage\.php\?dl=/.test(href)) return; // server counts it 23 if (a.hasAttribute('download') || /\.(html|zip|csv|pdf)$/i.test(href)) send('download', href); 24 else if (a.href && /\/free-help\//.test(a.getAttribute('href') || '') && a.closest('.controls')) send('launch', a.getAttribute('href')); 25 }, true); 26 window.easUsage = send; 27})();
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.