Annotate (live app): allow selecting and annotating elements inside same-origin iframes of the proxied page
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- html, typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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!
- Lenguaje dominante
- TypeScript
- Estrellas
- 8.7k
- Forks
- 649
- Merge medio
- 16 h 1 min
- PR fusionados (30 d)
- 756
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de backnotprop/plannotator
-
Inbox: numbered choices in a :::question become free text, and context bullets become the choicesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
backnotprop/plannotator#4132 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Claude Code: "classic.PermissionRequest hook was skipped" notice is back on Bash permission promptsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
backnotprop/plannotator#4051 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
backnotprop/plannotator#4000 ·
Los mantenedores suelen responder en 1 día
-
PR description is hidden when a PR review opens on a phonePosiblemente ocupada @flipcyde101 la tomó hace 8 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
backnotprop/plannotator#3667 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
backnotprop/plannotator#2643 · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de backnotprop/plannotator
Issues similares
-
enhancement status:needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
dongdongbh/Mindwtr#1625 ·
Los mantenedores suelen responder en 1 día
-
area/ui-schema good first issue type/bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
duckdb/duckdb-wasm#2335 ·
Los mantenedores suelen responder en 1 día