Skip to content

Iframes | Allow clipboard copy and paste from simulations - #43

Merged
BrianGenisio merged 1 commit into
mainfrom
fix/iframe-clipboard
Aug 21, 2026
Merged

Iframes | Allow clipboard copy and paste from simulations#43
BrianGenisio merged 1 commit into
mainfrom
fix/iframe-clipboard

Conversation

@BrianGenisio

@BrianGenisio BrianGenisio commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Side-content iframes (simulation, markdown reference, and external URL) can use the clipboard, so copy and paste inside a sim works.

Changes

Permissions Policy does not grant clipboard to iframes by default. .activity-content-iframe now sets allow="clipboard-read; clipboard-write".

The examples picker wraps /play in #app-frame. Nested iframes only get clipboard if every ancestor delegates it, so the picker iframe gets the same allow list.

Test plan

  • npm run examples, pick a /sim/ example, copy text from the simulation panel and paste it into a blank or text input
  • Same check on /play without the picker (npm start with a sim question.md)

Co-authored-by: Cursor <cursoragent@cursor.com>
@BrianGenisio
BrianGenisio marked this pull request as ready for review August 21, 2026 10:27
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 01f8c840-ab96-470b-b616-45d35e64ee1d

📥 Commits

Reviewing files that changed from the base of the PR and between f375995 and a948b75.

📒 Files selected for processing (2)
  • public/examples-mode.html
  • public/utils/activity-content-shell.js

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The preview iframe in public/examples-mode.html and the activity content iframe in public/utils/activity-content-shell.js now declare clipboard-read and clipboard-write permissions through the allow attribute. The preview iframe retains its /play source.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: enabling clipboard copy and paste in simulation iframes.
Description check ✅ Passed The description accurately explains the clipboard permissions, affected iframes, nested iframe behavior, and test plan.

Comment @coderabbitai help to get the list of available commands.

@BrianGenisio
BrianGenisio merged commit edde91c into main Aug 21, 2026
3 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