Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[daggy u] Fix iframed snippet copy behavior #19069

Merged
merged 1 commit into from
Jan 8, 2024
Merged

Conversation

hellendag
Copy link
Member

@hellendag hellendag commented Jan 8, 2024

Summary & Motivation

We received a report from a Dagster University user that the button to copy code snippets is failing in Chrome, due to a permissions limitation on the Clipboard API. I'm not sure if this has been broken for a while, but I was able to repro the issue.

Work around this by using the old fashioned execCommand behavior to write to the clipboard without the Clipboard API.

How I Tested These Changes

yarn build, yarn start. Load an iframe with no allow values set, with a course page loaded:

<html>
  <body>
    <iframe src="http://localhost:3000/dagster-essentials/lesson-3/defining-your-first-asset" />
  </body>
</html>

(In comparison, the Thinkific iframe allows a handful of features, but similarly does not allow any Clipboard access.)

Scroll to a code snippet, verify that I can successfully copy the snippet using the clipboard button. Verify also that newlines and whitespace are correct.

@hellendag
Copy link
Member Author

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

Copy link
Collaborator

@bengotow bengotow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird... this new version seems safe to me, I wonder if this was a new security change of some sort, it must have worked at some point!

Copy link

github-actions bot commented Jan 8, 2024

Deploy preview for dagster-docs ready!

Preview available at https://dagster-docs-g7dewnmtk-elementl.vercel.app
https://dish-daggy-u-copy.dagster.dagster-docs.io

Direct link to changed pages:

@hellendag hellendag merged commit 4af5f22 into master Jan 8, 2024
2 of 3 checks passed
@hellendag hellendag deleted the dish/daggy-u-copy branch January 8, 2024 17:41
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.

3 participants