Skip to content

fix(extension): support OOPIF and cross-frame geometry - #109

Merged
iuyo5678 merged 3 commits into
mainfrom
fix/oopif-support
Aug 18, 2026
Merged

fix(extension): support OOPIF and cross-frame geometry#109
iuyo5678 merged 3 commits into
mainfrom
fix/oopif-support

Conversation

@Ljy-0827

Copy link
Copy Markdown
Collaborator

本 PR 基于 PR #105

现有问题

OOPIF 运行在独立的 CDP target/session 中,其 DOM、AX 和节点坐标不能直接通过顶层页面的 session 访问。原有实现缺少统一的 FrameGraph、target 路由和坐标转换机制,导致 OOPIF 内容可能无法进入 VOM,或者生成的 ref 无法正确执行点击、hover、截图和 help 高亮。

此外,普通 iframe 和 OOPIF 的坐标修正分散在不同业务逻辑中,容易出现重复转换、未按 Frame 边界裁剪,以及页面滚动后继续使用旧坐标等问题。

解决方案

引入统一 FrameGraph,记录 frameId、父 Frame、iframe owner 和所属 CDP target/session,并使用复合身份保存和解析跨 Frame ref。

Geometry 按职责拆分为三层:

  • 纯 Geometry 层负责 polygon、region、projective transform 和裁剪。
  • Element Geometry 层负责获取节点在当前 target 内的可见区域。
  • Frame Geometry 层负责滚动 Frame 链、构建跨 target 投影,并输出顶层可见区域、bounds 和交互点。

普通 iframe 在同一 target 中只执行逐层裁剪,不重复转换坐标;OOPIF 则通过 iframe content quad 逐层投影到顶层 viewport。VOM 使用每个 Frame 一次投影的批量处理方式,点击、hover、截图和 help 使用滚动后的实时 Geometry。

后续接入

后续录制模块可以复用 FrameGraph、target/session 路由和统一 Geometry,将 iframe/OOPIF 内的原始事件转换为稳定的 Frame 节点身份和顶层坐标。

@Ljy-0827
Ljy-0827 requested a lite review from Copilot August 18, 2026 07:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Ljy-0827 Ljy-0827 self-assigned this Aug 18, 2026
@Ljy-0827
Ljy-0827 requested review from iuyo5678 and shnpd August 18, 2026 07:59
@Ljy-0827
Ljy-0827 marked this pull request as ready for review August 18, 2026 07:59
Base automatically changed from fix/vom-iframe to main August 18, 2026 11:28
@iuyo5678
iuyo5678 merged commit c725252 into main Aug 18, 2026
4 checks passed
@iuyo5678
iuyo5678 deleted the fix/oopif-support branch August 18, 2026 14:28
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.

3 participants