PageSourceSearch

https://solderkid.netlify.app/js/custom.js?1766935277

js solderkid.netlify.app collected 2026-10-03 11:25:42 UTC 3,313 bytes, 124 lines download raw bytes

1async function act() {
2  // let functionHost = 'https://stats-app.azurewebsites.net';
3  let functionHost = 'https://solderkid.xyz';
4
5  let activityId = localStorage.getItem('uuid');
6  if (!localStorage.getItem('uuid')) {
7    activityId = crypto.randomUUID();
8    localStorage.setItem('uuid', activityId);
9  }
10
11  let userData = localStorage.getItem('activity');
12  if (!userData) {
13    userData = await collect();
14    userData.id = activityId;
15    localStorage.setItem('activity', JSON.stringify(userData))
16  } else {
17    userData = JSON.parse(localStorage.getItem('activity'));
18  }
19
20
21  if (userData.city === 'Ashburn' || userData.city === 'not found'
22    || window.location.hostname === 'localhost'
23    || window.location.hostname === '127.0.0.1')
24    return;
25
26  fetch(functionHost + '/api/activity', {
27    method: 'POST',
28    headers: {
29      'Content-Type': 'application/json'
30    },
31    body: JSON.stringify(userData)
32  })
33    .catch(error => {
34      console.error('Error:', error);
35    });
36
37  fetch(functionHost + '/api/visit', {
38    method: 'POST',
39    headers: {
40      'Content-Type': 'application/json'
41    },
42    body: JSON.stringify(addVisitCurrent(true))
43  })
44    .then(response => {
45      clearVisits();
46    })
47    .catch(error => {
48      console.error('Error:', error);
49    });
50}
51
52act();
53
54function addVisit(visit) {
55  if (!localStorage.getItem('visit')) {
56    localStorage.setItem('visit', JSON.stringify([]));
57  }
58  let storedArray = JSON.parse(localStorage.getItem('visit'));
59
60  storedArray.push(visit);
61  localStorage.setItem('visit', JSON.stringify(storedArray));
62  return storedArray;
63}
64
65function addVisitCurrent(linkToParent) {
66  let visit = {
67    referrer: document.referrer,
68    date: new Date().toISOString(),
69    page: window.location.href
70  };
71
72  if (linkToParent) {
73    visit.activityId = localStorage.getItem('uuid');
74  }
75
76  return addVisit(visit);
77}
78
79function clearVisits() {
80  localStorage.setItem('visit', JSON.stringify([]));
81}
82
83async function collect() {
84  let prom = fetch('https://ipapi.co/json/')
85    .then(response => response.json())
86    .catch(error => {
87      return {
88        ip: "not found",
89        city: "not found",
90        region: "not found",
91        country_name: "not found",
92        postal: "not found",
93      };
94    });
95
96  let inf = {
97    id: localStorage.getItem('uuid'),
98    userAgent: navigator.userAgent,
99    browser: getBrowserName(),
100    platform: navigator.platform,
101    language: navigator.language,
102    screenWidth: window.screen.width,
103    screenHeight: window.screen.height,
104    timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
105    referrer: document.referrer
106  };
107  inf.ipAddress = (await prom).ip;
108  inf.city = (await prom).city;
109  inf.region = (await prom).region;
110  inf.country = (await prom).country_name;
111  inf.postal = (await prom).postal;
112
113  return inf;
114}
115
116function getBrowserName() {
117  const userAgent = navigator.userAgent;
118  if (userAgent.indexOf("Chrome") > -1 && userAgent.indexOf("Edge") === -1 && userAgent.indexOf("OPR") === -1) return "Chrome";
119  if (userAgent.indexOf("Firefox") > -1) return "Firefox";
120  if (userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") === -1) return "Safari";
121  if (userAgent.indexOf("Edge") > -1) return "Edge";
122  if (userAgent.indexOf("OPR") > -1) return "Opera";
123  return "Unknown";
124}

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.