better handling for logged-in users

This commit is contained in:
Sascha Leib
2025-09-04 09:44:01 +02:00
parent 0359f2509a
commit 13c9d29d29
4 changed files with 25 additions and 14 deletions

View File

@@ -54,9 +54,11 @@ botmon_client = {
_onHeartbeat: async function(url) {
//console.info('botmon_client._onHeartbeat', url);
let uid = document._botmon.user || null;
try {
const response = await fetch(url + '?p=' + encodeURIComponent(JSINFO.id) + '&t=' + Date.now(), {
//method: 'HEAD',
const response = await fetch(url + '?p=' + encodeURIComponent(JSINFO.id) + '&t=' + Date.now() + ( uid ? '&u=' + encodeURIComponent(uid) : ''), {
method: 'HEAD'
});
if (!response.ok) {
throw new Error(response.status + ' ' + response.statusText + ' - ' + url);