fix(extension): support OOPIF and cross-frame geometry - #109
Merged
Conversation
Ljy-0827
marked this pull request as ready for review
August 18, 2026 07:59
iuyo5678
force-pushed
the
fix/oopif-support
branch
from
August 18, 2026 11:18
b8a68d4 to
735c446
Compare
iuyo5678
force-pushed
the
fix/oopif-support
branch
from
August 18, 2026 11:28
735c446 to
0b65b4b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
本 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 按职责拆分为三层:
普通 iframe 在同一 target 中只执行逐层裁剪,不重复转换坐标;OOPIF 则通过 iframe content quad 逐层投影到顶层 viewport。VOM 使用每个 Frame 一次投影的批量处理方式,点击、hover、截图和 help 使用滚动后的实时 Geometry。
后续接入
后续录制模块可以复用 FrameGraph、target/session 路由和统一 Geometry,将 iframe/OOPIF 内的原始事件转换为稳定的 Frame 节点身份和顶层坐标。