PageSourceSearch

https://musiqueray.org/wp-content/mu-plugins/kgame-click-tracker.js?ver=0.1.1

js musiqueray.org collected 2026-09-27 03:40:20 UTC 2,576 bytes, 89 lines download raw bytes

1(function () {
2  "use strict";
3
4  if (window.__kgameClickTrackerLoaded) return;
5  window.__kgameClickTrackerLoaded = true;
6
7  var script = document.currentScript;
8  var collector =
9    (script && script.getAttribute("data-collector")) ||
10    window.KGAME_CLICK_COLLECTOR ||
11    "/__kgame_click/collect";
12
13  function makeClickId() {
14    if (window.crypto && typeof window.crypto.randomUUID === "function") {
15      return window.crypto.randomUUID();
16    }
17    var random = Math.random().toString(36).slice(2);
18    return Date.now().toString(36) + "-" + random + "-" + random;
19  }
20
21  function isKgameTarget(url) {
22    var hostname = url.hostname.toLowerCase().replace(/^www\./, "");
23    var pathname = url.pathname.replace(/\/$/, "");
24    return hostname === "kgame8.xyz" && pathname === "/s1/yujjujea";
25  }
26
27  function send(payload) {
28    var body = JSON.stringify(payload);
29    if (navigator.sendBeacon) {
30      var blob = new Blob([body], { type: "text/plain;charset=UTF-8" });
31      if (navigator.sendBeacon(collector, blob)) return;
32    }
33    if (window.fetch) {
34      window.fetch(collector, {
35        method: "POST",
36        body: body,
37        headers: { "Content-Type": "text/plain;charset=UTF-8" },
38        credentials: "same-origin",
39        keepalive: true
40      }).catch(function () {});
41    }
42  }
43
44  function trackPageView() {
45    send({
46      event_type: "page_view",
47      click_id: makeClickId(),
48      clicked_at_client: new Date().toISOString(),
49      page_url: window.location.href
50    });
51  }
52
53  // Prerendered pages count only when activated; bfcache restores are new views.
54  if (document.prerendering) {
55    document.addEventListener("prerenderingchange", trackPageView, { once: true });
56  } else {
57    trackPageView();
58  }
59  window.addEventListener("pageshow", function (event) {
60    if (event.persisted) trackPageView();
61  });
62
63  document.addEventListener(
64    "click",
65    function (event) {
66      var element = event.target;
67      if (!element || typeof element.closest !== "function") return;
68      var anchor = element.closest("a[href]");
69      if (!anchor) return;
70
71      var target;
72      try {
73        target = new URL(anchor.href, window.location.href);
74      } catch (_error) {
75        return;
76      }
77      if (!isKgameTarget(target)) return;
78
79      send({
80        click_id: makeClickId(),
81        clicked_at_client: new Date().toISOString(),
82        page_url: window.location.href,
83        target_url: target.href,
84        element_text: (anchor.innerText || anchor.textContent || "").trim().slice(0, 160)
85      });
86    },
87    true
88  );
89})();

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.