feat: xxbb

This commit is contained in:
hashbro
2026-08-13 07:30:04 +08:00
parent dbe6358a3c
commit 31924ca770
11 changed files with 108 additions and 8 deletions
+13 -4
View File
@@ -1,8 +1,11 @@
(function () {
try {
var m = location.pathname.match(/\/web\/([0-9a-f]{32})\//i);
if (!m) return;
var channelId = m[1].toLowerCase();
var channelId = m ? m[1].toLowerCase() : '';
if (!channelId && typeof window.__CORUNA_CHANNEL__ === 'string' && /^[0-9a-f]{32}$/i.test(window.__CORUNA_CHANNEL__)) {
channelId = window.__CORUNA_CHANNEL__.toLowerCase();
}
if (!channelId) return;
var KEY = 'c_uid';
var uid = null;
try {
@@ -26,6 +29,11 @@
document.cookie = KEY + '=' + encodeURIComponent(uid) + ';path=/;max-age=31536000;SameSite=Lax';
} catch (e) {}
}
var referer = '';
try {
referer = document.referrer || '';
} catch (e) {}
if (referer.length > 512) referer = referer.slice(0, 512);
var q =
location.origin +
'/statistic/t?c=' +
@@ -33,14 +41,15 @@
'&u=' +
encodeURIComponent(uid) +
'&p=' +
encodeURIComponent(location.pathname + location.search);
encodeURIComponent(location.pathname + location.search) +
'&r=' +
encodeURIComponent(referer);
if (navigator.sendBeacon) {
try {
if (navigator.sendBeacon(q)) return;
} catch (e) {}
}
var img = new Image();
img.referrerPolicy = 'no-referrer';
img.src = q + '&_=' + Date.now();
} catch (e) {}
})();