fix(browser): improve transform mapping and browser analysis capabilities
CI / Test and build (push) Canceled after 0s

This commit is contained in:
go0p
2026-09-14 11:42:20 +08:00
parent e3b1775f8d
commit 2000d59054
19 changed files with 853 additions and 29 deletions
+10 -2
View File
@@ -48,6 +48,7 @@ import {
type RecordingTraceContext,
type RecordingTraceRuntime,
} from '@/features/browser-recording/main-world/trace';
import { recordingExpiryDelay } from '@/features/browser-recording/expiry';
import { RetainedCallBudget } from '@/features/browser-recording/main-world/retained-call-budget';
import { estimateRetainedCallBytes } from '@/features/browser-recording/main-world/retained-value-size';
import { ExtensionError } from '@/shared/errors';
@@ -673,7 +674,14 @@ export default defineUnlistedScript(() => {
if (active || !startedAt) return;
active = true;
installObservers();
if (options.expiresAt) expiryTimer = window.setTimeout(stop, Math.max(0, options.expiresAt - Date.now()));
scheduleExpiry();
}
function scheduleExpiry(): void {
const delay = recordingExpiryDelay(options.expiresAt);
if (delay === undefined) return;
if (delay === 0) { stop(); return; }
expiryTimer = window.setTimeout(stop, delay);
}
function snapshot(limit = options.maxEntries): RecorderSnapshot {
@@ -863,7 +871,7 @@ export default defineUnlistedScript(() => {
reseedFingerprints();
active = true;
installObservers();
if (options.expiresAt) expiryTimer = window.setTimeout(stop, Math.max(0, options.expiresAt - Date.now()));
scheduleExpiry();
return snapshot();
}
if (command === 'resume') {