This commit is contained in:
Rohid
2024-08-15 22:31:31 +06:00
parent fce2c9cc50
commit 1faf392581

View File

@@ -170,6 +170,7 @@ class WakaTimeCore {
if (!contains(url, items.blacklist as string)) {
await this.sendHeartbeat(
{
branch: null,
hostname: items.hostname as string,
project,
url,
@@ -189,6 +190,7 @@ class WakaTimeCore {
await this.sendHeartbeat(
{
...heartbeat,
branch: null,
hostname: items.hostname as string,
project: heartbeat.project ?? project,
},
@@ -340,12 +342,12 @@ class WakaTimeCore {
let userAgent;
if (IS_FIREFOX) {
browserName = 'firefox';
userAgent = navigator.userAgent.match(/Firefox\/\S+/g)![0];
userAgent = navigator.userAgent.match(/Firefox\/\S+/g)?.[0];
} else if (IS_EDGE) {
browserName = 'edge';
userAgent = navigator.userAgent;
} else {
userAgent = navigator.userAgent.match(/Chrome\/\S+/g)![0];
userAgent = navigator.userAgent.match(/Chrome\/\S+/g)?.[0];
}
const payload: Record<string, unknown> = {
entity: heartbeat.url,