Skip to content

fix(recording): support user action recording in iframes and OOPIFs - #115

Open
Ljy-0827 wants to merge 3 commits into
fix/trace-v3-multitab-statefrom
fix/recorder-iframe
Open

fix(recording): support user action recording in iframes and OOPIFs#115
Ljy-0827 wants to merge 3 commits into
fix/trace-v3-multitab-statefrom
fix/recorder-iframe

Conversation

@Ljy-0827

Copy link
Copy Markdown
Collaborator

问题说明

现有录制机制仅能稳定捕获顶层页面中的用户操作,无法覆盖 iframe 和 OOPIF 内部的点击、输入、选择等事件。为支持跨 Frame 录制,本分支将录制界面与实际事件捕获拆分为独立链路,但早期实现中录制启动、Frame 管理和操作接收没有共享同一套运行时状态,导致页面虽然显示“正在录制”,实际的捕获模块却可能没有启动,顶层页面与 iframe 操作均无法进入最终 Trace。

此外,跨 Frame 场景需要正确区分不同 tab、Frame 和 Document 中的事件来源,并处理多个 iframe、页面导航、Document 替换以及停止录制时的统一刷新,避免事件串扰、重复记录或最后一批操作丢失。

解决方案

本 PR 引入统一的 Frame 录制协调机制,由后台集中管理录制生命周期,并在每个可录制的 Frame 中启动独立的捕获模块。每个捕获模块通过明确的 Document 和 producer 身份完成注册,录制步骤在进入 Trace 前会校验其来源,从机制上支持同页面多个 iframe、OOPIF 以及导航后的新 Document。

同时统一了录制运行时的依赖构造与传递,使录制启动、操作接收、页面恢复、停止刷新和 Trace 生成共享同一套协调状态。录制启动不再仅依赖界面层的确认,而是要求真实捕获链路成功建立;停止时则先刷新所有 Frame 中尚未提交的操作,再生成最终 Trace。

该实现保持现有 Trace v2/v3、页面观察、多标签页和目标识别逻辑不变,并补充了 Frame 协调、捕获模块及生产装配链路的回归测试。实际页面验证中,顶层页面和 iframe 内操作均已能够正确进入 Trace v3。

@Ljy-0827 Ljy-0827 self-assigned this Aug 19, 2026
@Ljy-0827
Ljy-0827 requested review from iuyo5678 and shnpd August 19, 2026 09:33
@Ljy-0827
Ljy-0827 marked this pull request as ready for review August 19, 2026 09:38
@Ljy-0827
Ljy-0827 force-pushed the fix/recorder-iframe branch from 19bf06b to c801085 Compare August 19, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant