Commit a94146c243

a94146c2436057866fabcd5034c06cb528f7c902

parent: 2f5d2b4500

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-09-01 06:32 UTC

Revert "aaa"

This reverts commit 2f5d2b4500a858cb744926d99803d119ddb37dd5.

Layout: unified · split

docs/.vitepress/theme/Layout.vue −33
@@ -1315,39 +1315,6 @@ onMounted(() => {
13151315 initTitleOnly()
13161316 nextTick(setupManualCopyButtons)
13171317
1318 // ping
1319 if (import.meta.env.PROD) {
1320 const API = 'https://ping.duckling.workers.dev'
1321 let vid = localStorage.getItem('_wa_vid')
1322 if (!vid) {
1323 vid = Array.from(crypto.getRandomValues(new Uint8Array(16)))
1324 .map(b => b.toString(16).padStart(2, '0')).join('')
1325 localStorage.setItem('_wa_vid', vid)
1326 }
1327 let currentPage = location.pathname
1328 function ping() {
1329 const page = location.pathname
1330 const isPageview = page !== currentPage
1331 currentPage = page
1332 fetch(API, {
1333 method: 'POST',
1334 headers: { 'Content-Type': 'application/json' },
1335 body: JSON.stringify({ v: vid, p: page, t: isPageview ? 'pageview' : 'heartbeat' }),
1336 keepalive: true
1337 })
1338 }
1339 ping()
1340 setInterval(ping, 10000)
1341 let lastPath = location.pathname + location.hash
1342 setInterval(() => {
1343 if (location.pathname + location.hash !== lastPath) {
1344 lastPath = location.pathname + location.hash
1345 currentPage = ''
1346 ping()
1347 }
1348 }, 1000)
1349 }
1350
13511318 // Icon tooltip: fixed-position popup appended to <body> to escape table overflow clipping
13521319 const tooltipEl = document.createElement('div')
13531320 tooltipEl.className = 'icon-tip-popup'