fix(browser): preserve unknown script ownership through reconciliation

This commit is contained in:
morluto
2026-10-24 04:18:57 +08:00
parent d397ac7427
commit d9a855f5cb
5 changed files with 80 additions and 4 deletions
@@ -157,7 +157,10 @@ const scriptEntities = (
nodeKind: "runtime-script-instance",
runtimeKey: script.script_key,
targetKey: capture.inspection.target.target_id,
frameKey: script.frame_id,
frameKey:
"frame_scope" in script && script.frame_scope === "unknown"
? null
: script.frame_id,
scriptKey: script.script_key,
location,
staticKind: "javascript",
@@ -176,6 +179,15 @@ const scriptEntities = (
...("reported_url" in script && script.reported_url !== undefined
? { reported_url: script.reported_url }
: {}),
...("frame_scope" in script && script.frame_scope !== undefined
? {
frame_scope: script.frame_scope,
reported_frame_id: script.frame_id,
}
: {}),
...("has_source_url" in script && script.has_source_url !== undefined
? { has_source_url: script.has_source_url }
: {}),
cdp_hash: script.cdp_hash,
length: script.length,
is_module: script.is_module,