Skip to content

feat: add iframe support to SOM compiler#39

Merged
dbhurley merged 1 commit intomasterfrom
feat/iframe-support
Apr 16, 2026
Merged

feat: add iframe support to SOM compiler#39
dbhurley merged 1 commit intomasterfrom
feat/iframe-support

Conversation

@dbhurley
Copy link
Copy Markdown
Member

Summary

  • Add ElementRole::Iframe to detect and represent <iframe> elements in SOM output
  • Capture key iframe attributes: src, srcdoc, name, sandbox, allow, width, height
  • Enable agents to understand embedded content boundaries without fetching iframe content

Changes

  • src/som/types.rs: Add Iframe variant to ElementRole
  • src/som/compiler.rs: Detect iframes and extract attributes
  • src/cdp/domains.rs, src/cdp/session.rs: Handle new role in CDP mappings
  • tests/: Add iframe detection and attribute tests

Example SOM output

{
  "id": "e_iframe_123",
  "role": "iframe",
  "attrs": {
    "src": "https://embed.example.com",
    "sandbox": "allow-scripts",
    "width": "800",
    "height": "600"
  }
}

Test plan

  • cargo test --test som_compiler_test iframe - 3 tests pass
  • cargo test --workspace - all 252+ tests pass

Generated with Claude Code

Detect <iframe> elements during SOM compilation and expose them as
ElementRole::Iframe with relevant attributes:
- src: URL of embedded content
- srcdoc: inline HTML content (has_srcdoc flag + preview)
- name: frame name for targeting
- sandbox: security restrictions
- allow: permissions policy
- width/height: dimensions

This enables agents to understand embedded content boundaries
without needing to fetch or execute iframe content.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
plasmate-app Ready Ready Preview, Comment Apr 16, 2026 0:09am

Request Review

@dbhurley dbhurley merged commit a1078ec into master Apr 16, 2026
2 of 4 checks passed
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