feat: update deps and insight
This commit is contained in:
@@ -6,11 +6,7 @@
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>aklive2d</title>
|
||||
<script
|
||||
id="counterscale-script"
|
||||
src="https://insight.halyul.dev/on-demand.js"
|
||||
defer
|
||||
></script>
|
||||
<link rel="canonical" href="https://arknights.halyul.dev/">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {createCustomEvent} from "@/components/helper"
|
||||
import * as Counterscale from "@counterscale/tracker";
|
||||
import { createCustomEvent } from "@/components/helper"
|
||||
|
||||
export default class Insight {
|
||||
#isInsightInited = false
|
||||
@@ -12,14 +13,19 @@ export default class Insight {
|
||||
this.#isInsightInited = true
|
||||
if (doNotTrack) return
|
||||
try {
|
||||
const config = {
|
||||
path: `/${import.meta.env.VITE_LINK}`
|
||||
const canonical = document.querySelector('link[rel="canonical"][href]')
|
||||
if (!canonical) {
|
||||
return;
|
||||
}
|
||||
if (isFromWallpaperEngine) config.hostname = "file://wallpaperengine.local";
|
||||
window.counterscale = {
|
||||
q: [["set", "siteId", import.meta.env.VITE_INSIGHT_ID], ["trackPageview", config]],
|
||||
};
|
||||
window.counterscaleOnDemandTrack();
|
||||
if (isFromWallpaperEngine) canonical.href = "file://wallpaperengine.local/";
|
||||
Counterscale.init({
|
||||
siteId: "aklive2d",
|
||||
reporterUrl: "https://insight.halyul.dev/collect",
|
||||
autoTrackPageviews: false,
|
||||
});
|
||||
Counterscale.trackPageview({
|
||||
url: `/${import.meta.env.VITE_LINK}`
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn && console.warn(e.message)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user