FE-1543: Grant clipboard permissions to the Petrinaut iframe - #9410
FE-1543: Grant clipboard permissions to the Petrinaut iframe#9410claude[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
PR SummaryLow Risk Overview This PR adds Manual browser verification (Chrome/Firefox) is still needed; paste behavior may depend on how each engine grants clipboard-read to sandboxed frames. Reviewed by Cursor Bugbot for commit c091e13. Bugbot is set up for automated code reviews on this repo. Configure here. |
Requested by Chris Feijoo · Slack thread
🌟 What is the purpose of this PR?
Copy and paste do not work in the Petrinaut editor as embedded in the HASH app's Processes page.
Before: the editor's copy and paste run through the async clipboard API. The Processes page embeds the editor in an iframe sandboxed without
allow-same-origin, so the frame has an opaque origin.clipboard-readandclipboard-writeare permission-policy controlled features whose default allowlist an opaque origin cannot match, so both calls are refused. The editor swallows the rejections, so the user sees nothing happen and the console stays quiet.After: the frame is granted both clipboard features with the
*allowlist, which is the one allowlist value that reaches an opaque origin —selfandsrccannot match one. Thesandboxattribute is untouched, so the frame keeps its opaque origin and its existing isolation.This change is unverified in a real browser. Chromium cannot be installed in the build environment, so it needs manual confirmation that copy and paste actually work in the embedded editor.
🔗 Related links
🚫 Blocked by
🔍 What does this change?
allow="clipboard-read *; clipboard-write *"to the Petrinaut iframe on the Processes page. One line; no other change.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
clipboard-writeto a page in an active tab and in a secure context, so delegating the feature may be all that copy needs. Paste is less certain —clipboard-readneeds a permission grant, and an opaque origin cannot hold a persisted one. Whether Chrome's ephemeral "Paste" prompt is offered to an opaque-origin frame is not something the documentation settles, and it could not be tested here.readText()to extensions for years and now exposes it to web content behind a paste prompt, so its behaviour in a sandboxed frame also needs checking.🐾 Next steps
clipboard-readstill fails because an opaque origin cannot hold a permission grant, the fallback is to drive copy and paste off thecopyandpasteDOM events instead. Those events carry their own clipboard data and need no permission policy.catchblocks around the clipboard calls should surface the failure rather than swallowing it.🛡 What tests cover this?
❓ How to test this?
📹 Demo
n/a