google / google/playground-elements

Unable to make use of Clipboard api copy and paste operations from different domain

Open
#362 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
648
Forks
61
PR merge metrics
No merged PRs in 30d

Description

We are making use of 'playground-elements/playground-ide' and we have a requirement where we want to test the behavior of a certain component of ours by copying some text from a different application or different website and pasting it in the playground-preview element of playground-ide, we get a warning stating that, we need to allow clipboard read and write on the iframe present in playground-preview as the source seems to be different for the iframe. As of now, there is no way to pass this configuration to iframe present inside playground-preview.

[Here](https://lit.dev/playground/#project=W3sibmFtZSI6InNpbXBsZS1ncmVldGluZy5qcyIsImNvbnRlbnQiOiJpbXBvcnQge2h0bWwsIGNzcywgTGl0RWxlbWVudH0gZnJvbSAnbGl0JztcblxuZXhwb3J0IGNsYXNzIFNpbXBsZUdyZWV0aW5nIGV4dGVuZHMgTGl0RWxlbWVudCB7XG4gIHN0YXRpYyBzdHlsZXMgPSBjc3NgcCB7IGNvbG9yOiBibHVlIH1gO1xuXG4gIHN0YXRpYyBwcm9wZXJ0aWVzID0ge1xuICAgIG5hbWU6IHt0eXBlOiBTdHJpbmd9LFxuICB9O1xuICBjb25zdHJ1Y3RvcigpIHtcbiAgICBzdXBlcigpO1xuICAgIHRoaXMubmFtZSA9ICdTb21lYm9keSc7XG4gIH1cbiAgaGFuZGxlQ2xpY2soKSB7XG4gICAgIG5hdmlnYXRvci5jbGlwYm9hcmRcbiAgICAucmVhZFRleHQoKVxuICAgIC50aGVuKFxuICAgICAgKGNsaXBUZXh0KSA9PiAoZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcIi5lZGl0b3JcIikuaW5uZXJUZXh0ICs9IGNsaXBUZXh0KVxuICAgICk7XG4gIH1cbiAgXG5cbiAgcmVuZGVyKCkge1xuICAgIHJldHVybiBodG1sYDxkaXY-PGJ1dHRvbiBAY2xpY2s9JyR7dGhpcy5oYW5kbGVDbGlja30nPlBhc3RlPC9idXR0b24-PHAgY2xhc3M9J2VkaXRvcjMnPkhlbGxvLCAke3RoaXMubmFtZX0hPC9wPjwvZGl2PmA7XG4gIH1cbn1cbmN1c3RvbUVsZW1lbnRzLmRlZmluZSgnc2ltcGxlLWdyZWV0aW5nJywgU2ltcGxlR3JlZXRpbmcpO1xuIn0seyJuYW1lIjoiaW5kZXguaHRtbCIsImNvbnRlbnQiOiI8IURPQ1RZUEUgaHRtbD5cbjxoZWFkPlxuICA8c2NyaXB0IHR5cGU9XCJtb2R1bGVcIiBzcmM9XCIuL3NpbXBsZS1ncmVldGluZy5qc1wiPjwvc2NyaXB0PlxuPC9oZWFkPlxuPGJvZHk-XG4gIDxzaW1wbGUtZ3JlZXRpbmcgbmFtZT1cIldvcmxkXCI-PC9zaW1wbGUtZ3JlZXRpbmc-XG48L2JvZHk-XG4ifSx7Im5hbWUiOiJwYWNrYWdlLmpzb24iLCJjb250ZW50Ijoie1xuICBcImRlcGVuZGVuY2llc1wiOiB7XG4gICAgXCJsaXRcIjogXCJeMi4wLjBcIixcbiAgICBcIkBsaXQvcmVhY3RpdmUtZWxlbWVudFwiOiBcIl4xLjAuMFwiLFxuICAgIFwibGl0LWVsZW1lbnRcIjogXCJeMy4wLjBcIixcbiAgICBcImxpdC1odG1sXCI6IFwiXjIuMC4wXCJcbiAgfVxufSIsImhpZGRlbiI6dHJ1ZX1d) is the preview of same behaviour

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.