PageSourceSearch

https://goloskaspia.ru/js/agent.js?v=1.2

js goloskaspia.ru collected 2026-10-08 13:57:14 UTC 1,389 bytes, 54 lines download raw bytes

1(function () {
2  function setCookie(name, value, days) {
3    var d = new Date();
4    d.setTime(d.getTime() + days * 24 * 60 * 60 * 1000);
5    document.cookie =
6      name +
7      '=' +
8      encodeURIComponent(value) +
9      ';expires=' +
10      d.toUTCString() +
11      ';path=/;SameSite=Lax';
12  }
13
14  function getCookie(name) {
15    var parts = document.cookie.split('; ');
16    for (var i = 0; i < parts.length; i++) {
17      var p = parts[i];
18      if (p.indexOf(name + '=') === 0) {
19        return p.substring(name.length + 1);
20      }
21    }
22    return '';
23  }
24
25  // Capture agent from URL once
26  try {
27    var params = new URLSearchParams(window.location.search);
28    var urlAgent = params.get('a');
29    var existing = getCookie('agent_id');
30    if (!existing && urlAgent) {
31      setCookie('agent_id', urlAgent, 60); // 60 days
32    }
33  } catch (e) {
34    // no-op
35  }
36
37  // Inject hidden field into all forms
38  document.addEventListener('DOMContentLoaded', function () {
39    var agentId = getCookie('agent_id');
40    if (!agentId) return;
41    var forms = document.querySelectorAll('form');
42    for (var i = 0; i < forms.length; i++) {
43      var f = forms[i];
44      if (f.querySelector('input[name="agent_id"]')) continue;
45      var h = document.createElement('input');
46      h.type = 'hidden';
47      h.name = 'agent_id';
48      h.value = agentId;
49      f.appendChild(h);
50    }
51  });
52})();
53
54

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.