Annotate (live app): allow selecting and annotating elements inside same-origin iframes of the proxied page
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- html, typescript
Hướng nghiên cứu
Start with the frame gate in packages/ui/components/html-viewer/bridge-script.ts and applyHtmlFramingHeaders in packages/shared/live-proxy-core.ts; trace how the bridge sends hover, selection, and rectangle events to the editor. Check how annotation targets are stored and add coverage for same-origin nested frames, including frame offsets and frame-specific selectors. Done means proxied same-site frames render and their elements can be annotated with the correct frame recorded.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi, and thanks for Plannotator. I would like to ask about annotating a local page that contains iframes.
Use case
I review designs with a "side-by-side" page: one local HTML page that places several <iframe>s next to each other, each showing a different page of the same site, or the same page at different viewport widths (for example 375 / 768 / 1280 px). I open that page with annotate (http://localhost:8080/compare.html) and want to comment on specific elements inside the individual frames ("this button is too close to the edge at 375 px").
Current behavior
- Only elements of the outermost page can be picked. Inside an iframe nothing can be selected; I can only mark the
<iframe>as a whole or the heading around it. As far as I can tell this is by design: the bridge is injected into every HTML response but returns early in nested frames (the frame gate near the top ofpackages/ui/components/html-viewer/bridge-script.ts), and its comments say live-app sessions leave a page's own frames alone. - If the iframes in
compare.htmluse the proxied origin, the browser blocks them. The proxy replaces the page's CSP withframe-ancestors <editor origins>(applyHtmlFramingHeadersinpackages/shared/live-proxy-core.ts), and the proxied page itself is not in that list, so a nested frame from the same proxy origin is refused and shows a broken-page icon. - Pointing the iframes at the original port (
http://localhost:8080/...) avoids the block, but then the frame content is cross-origin to the proxied outer page, so no annotation script can reach into it.
Minimal repro:
- Create
index.html,a.htmlandcompare.htmlin a folder.compare.htmlcontains:<h1>Compare</h1> <iframe src="/index.html" width="375" height="600"></iframe> <iframe src="/a.html" width="768" height="600"></iframe> - Serve it:
python3 -m http.server 8080 --bind 127.0.0.1 - Run
/plannotator-annotate http://localhost:8080/compare.html. - Result: the frames are broken (blocked by
frame-ancestors). If they are made to load (absolute URLs to the original port), only the whole<iframe>can be annotated, not elements inside it.
Expected behavior
For iframes that load from the same proxied site, the frames render, and elements inside them can be hovered, selected and annotated like elements of the outer page. The annotation should record which frame it belongs to.
Possible approach (just a suggestion, you know the design far better)
- Let
frame-ancestorsalso allow the proxied origin itself ('self'in addition to the editor origins), so same-site nesting works while other sites still cannot frame the proxy. - Let the bridge run in same-origin subframes of the proxied page (relax the frame gate for frames whose ancestor chain is proxy origin -> editor), and forward hover, selection and rect events to the editor with the frame's position offset.
- Record the target as an "iframe selector + inner selector" pair (for example
iframe:nth-of-type(2) >>> button.primary), which also works for nested frames. - Possibly opt-in (a setting or flag), since the current behavior is deliberate for apps that own their frames.
Environment
- Plannotator version: 0.29.4 (
plannotator --version) - OS: macOS
- Agent: Claude Code
- Where: Annotate (live app via local URL)
Happy to test a build or help narrow this down. Thank you!
- Ngôn ngữ chính
- TypeScript
- Star
- 8.7k
- Fork
- 649
- Merge trung bình
- 16 giờ 1 phút
- Pull request đã merge (30 ngày)
- 756
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của backnotprop/plannotator
-
Inbox: numbered choices in a :::question become free text, and context bullets become the choicesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
backnotprop/plannotator#4132 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Claude Code: "classic.PermissionRequest hook was skipped" notice is back on Bash permission promptsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
backnotprop/plannotator#4051 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
backnotprop/plannotator#4000 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
PR description is hidden when a PR review opens on a phoneCó thể đã có người làm @flipcyde101 đã nhận 8 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
backnotprop/plannotator#3667 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
backnotprop/plannotator#2643 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của backnotprop/plannotator
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
-
review-followup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
griffinwork40/agent-afk#5387 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
CodeManufactoryLLC/Code60#358 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
android:plan ios:plan main:plan packages:learn
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày