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

Allow different mimetypes for the clipboard data #7202

Merged
merged 1 commit into from
Sep 16, 2019

Conversation

Madhu94
Copy link
Contributor

@Madhu94 Madhu94 commented Sep 12, 2019

This should allow multiple mime types on the clipboard, for #7119

Let me know your thoughts on this.

@jupyterlab-dev-mode
Copy link

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Thanks!

@blink1073 blink1073 modified the milestones: 1.1.x, 1.2 Sep 13, 2019
@Madhu94
Copy link
Contributor Author

Madhu94 commented Sep 13, 2019

Thoughts on using the new Async Clipboard API and falling back to the current implementation on Safari ? (mdn's compat table says clipboard API support is unknown for Safari)

@blink1073
Copy link
Contributor

In this case I don't think the capability is worth the added complexity of two code paths.

@Madhu94
Copy link
Contributor Author

Madhu94 commented Sep 13, 2019 via email

@blink1073
Copy link
Contributor

blink1073 commented Sep 13, 2019 via email

@Madhu94
Copy link
Contributor Author

Madhu94 commented Sep 14, 2019

I tried out the async API - the error messages were really great (in the old way, you never know why document.execCommand would fail) and there is not need to write the data you want to copy to the DOM first before invoking this API.

But I also faced problems -

  • It does not allow any mime type other than text/plain or image/png. It errored when I tried text/html
  • It is better to use it with the Permissions API, which is good, but the required "clipboard-write" permission doesn't seem to be supported supported in Firefox.
  • TS typings may not have caught up yet ? ( ClipboardItem name is unknown) So I made a global.d.ts to work around for the moment.
  • As mentioned above, Safari support doesn't seem to be implemented yet (I haven't verified behavior on Safari yet).

Maybe we can wait for the API to improve a bit?

@Madhu94
Copy link
Contributor Author

Madhu94 commented Sep 14, 2019

Some references - original proposal and recent status update

@blink1073
Copy link
Contributor

Waiting sounds good to me, so this is ready to merge?

@Madhu94
Copy link
Contributor Author

Madhu94 commented Sep 16, 2019

Yeah, ready for review/merge

@blink1073
Copy link
Contributor

Thanks!

@jasongrout
Copy link
Contributor

@meeseeksdev backport to 1.x

meeseeksmachine pushed a commit to meeseeksmachine/jupyterlab that referenced this pull request Sep 18, 2019
jasongrout added a commit that referenced this pull request Sep 18, 2019
…2-on-1.x

Backport PR #7202 on branch 1.x (Allow different mimetypes for the clipboard data)
@jasongrout jasongrout modified the milestones: 1.2, 2.0 Oct 11, 2019
@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Nov 10, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Nov 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement pkg:apputils status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants