Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- const file_id = "2768397",
- visitorData = {
- file_id: "2768397",
- gpu: null,
- cpu: null,
- screen_res: `${screen.width}x${screen.height}`,
- iframe_size: `${window.innerWidth}x${window.innerHeight}`,
- mouse_position: "",
- click_position: "",
- page_duration: 0,
- referer: document.referrer || window.location.href,
- watch_time: 0,
- tab_visibility_changes: 0
- };
- let startTime = Date.now(),
- lastActivityTime = Date.now(),
- inactivityStart = null;
- function updateActivity() {
- lastActivityTime = Date.now()
- }
- document.addEventListener("mousemove", t => {
- visitorData.mouse_position = `${t.pageX}x${t.pageY}`, updateActivity()
- }), document.addEventListener("click", t => {
- visitorData.click_position = `${t.pageX}x${t.pageY}`, updateActivity()
- }), document.addEventListener("visibilitychange", () => {
- document.hidden && visitorData.tab_visibility_changes++
- }), setInterval(() => {
- let t = Date.now();
- t - lastActivityTime >= 1e4 && !inactivityStart ? inactivityStart = lastActivityTime : t - lastActivityTime < 1e4 && inactivityStart && (inactivityStart = null)
- }, 1e3);
- try {
- let t = document.createElement("canvas"),
- i = t.getContext("webgl") || t.getContext("experimental-webgl"),
- a = i.getExtension("WEBGL_debug_renderer_info");
- visitorData.gpu = a ? i.getParameter(a.UNMASKED_RENDERER_WEBGL) : "Unknown"
- } catch {
- visitorData.gpu = "Unavailable"
- }
- visitorData.cpu = navigator.hardwareConcurrency ? `${navigator.hardwareConcurrency} cores` : "Unknown";
- let hasSentData = !1;
- function sendVisitorData() {
- hasSentData || (hasSentData = !0, visitorData.page_duration = Math.round((Date.now() - startTime) / 1e3), visitorData.watch_time = Math.round(totalWatchTime), fetch("/ajax/data", {
- method: "POST",
- headers: {
- "Content-Type": "application/json"
- },
- body: JSON.stringify(visitorData)
- }).catch(() => {}))
- }
- setInterval(() => {
- "undefined" != typeof totalWatchTime && !hasSentData && Math.floor(totalWatchTime) >= 87 && sendVisitorData()
- }, 500);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment