فهرست منبع

配置测试大学的阿里云前端监控

Michael Wang 5 سال پیش
والد
کامیت
f1c121e65f
1فایلهای تغییر یافته به همراه23 افزوده شده و 32 حذف شده
  1. 23 32
      public/index.html

+ 23 - 32
public/index.html

@@ -41,38 +41,29 @@
     <script>
       if (false && location.host.includes("ecs.qmth.com.cn")) {
         (async function() {
-          var __sampleRateInt = 100;
-          try {
-            var res = await fetch("/electron-config/ali-arms.js", {
-              cache: "no-store",
-            });
-            var text = await res.text();
-            __sampleRateInt = parseInt(text) || 100;
-          } catch (error) {
-            console.log(error);
-          } finally {
-            console.log("ARMS sample: " + __sampleRateInt);
-
-            !(function(c, b, d, a) {
-              c[a] || (c[a] = {});
-              c[a].config = {
-                pid: "hworw@48e147d26fd751a",
-                enableSPA: true,
-                sample: __sampleRateInt,
-                sendResource: true,
-                imgUrl: "https://arms-retcode.aliyuncs.com/r.png?",
-              };
-              with (b)
-                with (body)
-                  with (insertBefore(createElement("script"), firstChild))
-                    setAttribute("crossorigin", "", (src = d));
-            })(
-              window,
-              document,
-              "https://retcode.alicdn.com/retcode/bl.js",
-              "__bl"
-            );
-          }
+          !(function(c, b, d, a) {
+            c[a] || (c[a] = {});
+            c[a].config = {
+              pid: "hworw@536497ba86039b9",
+              enableSPA: false,
+              sample: 1,
+              sendResource: false,
+              behavior: true,
+              imgUrl: "https://arms-retcode.aliyuncs.com/r.png?",
+              ignore: {
+                ignoreUrls: [/.+?hm\.baidu\.com.+/],
+              },
+            };
+            with (b)
+              with (body)
+                with (insertBefore(createElement("script"), firstChild))
+                  setAttribute("crossorigin", "", (src = d));
+          })(
+            window,
+            document,
+            "https://retcode.alicdn.com/retcode/bl.js",
+            "__bl"
+          );
         })();
       }
     </script>