diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-03-14 17:51:09 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-03-14 17:51:09 +0800 |
| commit | d1e0eac47fecc0316568bc011dc833963f0502de (patch) | |
| tree | 92e276d8fff96dc408440110c5cbec05a0c12ee5 | |
| parent | 78c9fba7fd9a7ccb9dfeeac175439dae1fec8cdd (diff) | |
fixed speed insights
| -rw-r--r-- | public/_vercel/insights/script.js | 1 | ||||
| -rw-r--r-- | public/index.html | 5 | ||||
| -rw-r--r-- | public/pages/info/about.html | 5 | ||||
| -rw-r--r-- | public/pages/repo/github/repos.html | 6 |
4 files changed, 12 insertions, 5 deletions
diff --git a/public/_vercel/insights/script.js b/public/_vercel/insights/script.js deleted file mode 100644 index fed1c985..00000000 --- a/public/_vercel/insights/script.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(()=>{function e(e){let t=location.href;if(e){let n=new URL(t);if(n.pathname!==e)return n.pathname=e,n.search="",n.href}return t}var t,n,a,i,r=(a=()=>{},()=>(a&&(i=a(a=0)),i));(t=()=>{r(),function(){let t=e=>e,n=document.currentScript,a=(null==n?void 0:n.dataset.endpoint)||(null!=n&&n.src.includes("/va/")?"/va":"/_vercel/insights"),i=null==n?void 0:n.dataset.disableAutoTrack,r=null,o=null,l=!0;async function s({type:i,data:l,options:s}){var u,d;let c=e(o),h=document.referrer,p=t({type:i,url:c});if(!1===p||null===p)return;p&&(c=p.url);let f=h.includes(location.host),v={o:c,sv:"0.1.2",sdkn:null!=(u=null==n?void 0:n.dataset.sdkn)?u:void 0,sdkv:null!=(d=null==n?void 0:n.dataset.sdkv)?d:void 0,ts:Date.now(),...r&&{dp:r},...null!=s&&s.withReferrer&&!f?{r:h}:{},..."event"===i&&l&&{en:l.name,ed:l.data}};try{await fetch(`${a}/${"pageview"===i?"view":"event"}`,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(v)})}catch(w){}}async function u(e={}){return s({type:"pageview",options:{withReferrer:e.withReferrer}})}async function d(e,t){return s({type:"event",data:{name:e,data:t},options:{withReferrer:!0}})}async function c(){await fetch(`${a}/session`,{method:"GET",keepalive:!0}).catch(()=>{})}function h(e){return e.pathname===new URL(f).pathname}function p(e){let t=e?"string"==typeof e?new URL(e,location.origin):new URL(e.href):null;!t||h(t)||Boolean(t.hash)&&h(t)||u()}let f=e(),v=()=>{var e;window.va=function(e,n){"beforeSend"===e?t=n:"event"===e?n&&d(n.name,n.data):"pageview"===e&&n&&(n.route&&(r=n.route),n.path&&(o=n.path),u({withReferrer:l}),l=!1),"enableCookie"===e&&c()},null==(e=window.vaq)||e.forEach(([e,t])=>{window.va(e,t)})};(()=>{if(window.vai||(window.vai=!0,v(),i))return;u({withReferrer:!0});let t=history.pushState.bind(history);history.pushState=function(...n){t(...n);try{p(n[2]),f=e()}catch(a){}},window.addEventListener("popstate",function(){p(e()),f=e()})})()}()},()=>(n||t((n={exports:{}}).exports,n),n.exports))()})();
\ No newline at end of file diff --git a/public/index.html b/public/index.html index 72559296..46eb2b52 100644 --- a/public/index.html +++ b/public/index.html @@ -57,8 +57,11 @@ <script defer src="/js/2dtilt.js"></script> <!-- <script defer src="/js/tilt.conf.noglare.js"></script> --> <script defer src="/js/dynamicBlob.js"></script> - <script defer src="/_vercel/insights/script.js"></script> <script src="/js/header.js"></script> <script src="/js/hacktype.js"></script> </body> + <script> + window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); }; + </script> + <script defer src="/_vercel/insights/script.js"></script> </html> diff --git a/public/pages/info/about.html b/public/pages/info/about.html index d104d967..be95b136 100644 --- a/public/pages/info/about.html +++ b/public/pages/info/about.html @@ -44,6 +44,9 @@ <script src="/js/about.js"></script> <script src="/js/header.js"></script> <script src="/js/dynamicBlob.js"></script> - <script defer src="/_vercel/insights/script.js"></script> </body> +<script> + window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); }; +</script> +<script defer src="/_vercel/insights/script.js"></script> </html> diff --git a/public/pages/repo/github/repos.html b/public/pages/repo/github/repos.html index f24c998a..d90b5b7b 100644 --- a/public/pages/repo/github/repos.html +++ b/public/pages/repo/github/repos.html @@ -39,8 +39,10 @@ <!-- <script defer src="/js/tilt.conf.noglare.js"></script> --> <script src="/js/header.js"></script> <script src="/js/hacktype.js"></script> - <script defer src="/_vercel/insights/script.js"></script> <script defer src="/js/dynamicBlob.js"></script> </body> - + <script> + window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); }; + </script> + <script defer src="/_vercel/insights/script.js"></script> </html> |
