PageSourceSearch

https://www.tinwingfoodtech.com/js/2dca2b7bb3f5b8f2d394a98e4109d13e/customerVisit.min.js

js tinwingfoodtech.com collected 2026-10-06 06:21:13 UTC 3,577 bytes, 109 lines download raw bytes

1// document.addEventListener("DOMContentLoaded", function () {
2//   //以下变量统一使用var,禁用let,兼容IE
3//   var customerVisitUrl = "https://www.twfrenchfries.com/api/customerVisit/";
4//   var customerVisitData = {};
5//   var requestPostType = "POST";
6
7//   function ajax(method, url, data, success) {
8//     var xhr = new XMLHttpRequest();
9//     xhr.open(method, url, true);
10//     xhr.setRequestHeader("Content-Type", "application/json");
11//     xhr.onreadystatechange = function () {
12//       if (xhr.readyState === 4) {
13//         if (xhr.status === 200) {
14//           success(xhr.responseText);
15//         } else {
16//           console.log("Error: " + xhr.status);
17//         }
18//       }
19//     };
20//     xhr.send(data);
21//   }
22
23//   // 获取当前网页的协议+域名
24//   function getPageBaseUrl() {
25//     var baseURL = "";
26//     if (!window.location.origin) {
27//       // 兼容IE,IE11版本下location.origin为undefined
28//       window.location.origin =
29//         window.location.protocol +
30//         "//" +
31//         window.location.hostname +
32//         (window.location.port ? ":" + window.location.port : "");
33//     } else {
34//       baseURL = window.location.origin;
35//     }
36//     return baseURL;
37//   }
38
39//   if (
40//     navigator.userAgent.match(/Mobi/i) ||
41//     navigator.userAgent.match(/Android/i) ||
42//     navigator.userAgent.match(/iPhone/i)
43//   ) {
44//     customerVisitData.device_port = "2";
45//   } else {
46//     customerVisitData.device_port = "1";
47//   }
48//   customerVisitData.url = window.location.href;
49//   customerVisitData.domain = getPageBaseUrl() + "/";
50//   customerVisitData.referrer_url = document.referrer;
51//   ajax(
52//     requestPostType,
53//     customerVisitUrl,
54//     JSON.stringify(customerVisitData),
55//     function (data) {}
56//   );
57// });
58(function () {  
59  var customerVisitUrl = "https://www.twfrenchfries.com/api/customerVisit/";
60  var customerVisitData = {};
61  var requestPostType = "POST";
62
63  function initVisit() {
64    function ajax(method, url, data, success) {
65      var xhr = new XMLHttpRequest();
66      xhr.open(method, url, true);
67      xhr.setRequestHeader("Content-Type", "application/json");
68      xhr.onreadystatechange = function () {
69        if (xhr.readyState === 4) {
70          if (xhr.status === 200) {
71            success(xhr.responseText);
72          } else {
73            console.log("Error: " + xhr.status);
74          }
75        }
76      };
77      xhr.send(data);
78    }
79
80    function getPageBaseUrl() {
81      var baseURL = window.location.origin;
82      if (!baseURL) {
83        baseURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
84      }
85      return baseURL;
86    }
87
88    if (navigator.userAgent.match(/Mobi/i) || navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/iPhone/i)) {
89      customerVisitData.device_port = "2";
90    } else {
91      customerVisitData.device_port = "1";
92    }
93    customerVisitData.url = window.location.href;
94    customerVisitData.domain = getPageBaseUrl() + "/";
95    customerVisitData.referrer_url = document.referrer;
96
97    ajax(requestPostType, customerVisitUrl, JSON.stringify(customerVisitData), function (data) {});
98  }
99
100  // --- 关键修复代码开始 ---
101  if (document.readyState === "interactive" || document.readyState === "complete") {
102    // 如果已经加载完成,直接运行
103    initVisit();
104  } else {
105    // 否则正常监听
106    document.addEventListener("DOMContentLoaded", initVisit);
107  }
108  // --- 关键修复代码结束 ---
109})();

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.