From e9164263156fe57e4c90b0ec5e9524ddc0c2091d Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Wed, 27 May 2026 12:39:38 -0700 Subject: [PATCH] revert changes --- src/recorder/index.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/recorder/index.js b/src/recorder/index.js index 6c62fa6fb..b3262c79c 100644 --- a/src/recorder/index.js +++ b/src/recorder/index.js @@ -12,20 +12,14 @@ import { record } from 'rrweb'; const website = config('website-id'); const hostUrl = config('host-url'); - const configHostUrl = config('config-host-url'); if (!website) return; - const scriptHost = currentScript.src.split('/').slice(0, -1).join('/'); - const collectHost = hostUrl || '__COLLECT_API_HOST__' || scriptHost; - const configHost = configHostUrl || scriptHost || collectHost; - const collectHostBase = collectHost.replace(/\/$/, ''); - const configHostBase = configHost.replace(/\/$/, ''); - const endpoint = `${collectHostBase}__COLLECT_REPLAY_ENDPOINT__`; - const configEndpoint = `${configHostBase}__RECORDER_CONFIG_ENDPOINT__`.replace( - '{websiteId}', - website, - ); + const host = + hostUrl || '__COLLECT_API_HOST__' || currentScript.src.split('/').slice(0, -1).join('/'); + const hostBase = host.replace(/\/$/, ''); + const endpoint = `${hostBase}__COLLECT_REPLAY_ENDPOINT__`; + const configEndpoint = `${hostBase}__RECORDER_CONFIG_ENDPOINT__`.replace('{websiteId}', website); const REPLAY_FLUSH_EVENT_COUNT = 100; const REPLAY_FLUSH_INTERVAL = 10000; @@ -342,7 +336,12 @@ import { record } from 'rrweb'; const onClick = event => { if (!event.isTrusted || event.button !== 0) return; - const { pageW: rawPageW, pageH: rawPageH, scrollLeft, scrollTop } = computePageMetrics({ + const { + pageW: rawPageW, + pageH: rawPageH, + scrollLeft, + scrollTop, + } = computePageMetrics({ includeBounds: true, }); const pageX = Number.isFinite(event.pageX) ? event.pageX : event.clientX + scrollLeft;