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
Collaborator

@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

@jupyterlab-dev-mode jupyterlab-dev-mode bot commented Sep 12, 2019

Thanks for making a pull request to JupyterLab!

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

Copy link
Member

@blink1073 blink1073 left a comment

Thanks!

@blink1073 blink1073 added this to the 1.1.x milestone Sep 13, 2019
@blink1073 blink1073 removed this from the 1.1.x milestone Sep 13, 2019
@blink1073 blink1073 added this to the 1.2 milestone Sep 13, 2019
@Madhu94
Copy link
Collaborator Author

@Madhu94 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
Member

@blink1073 blink1073 commented Sep 13, 2019

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

@Madhu94
Copy link
Collaborator Author

@Madhu94 Madhu94 commented Sep 13, 2019

@blink1073
Copy link
Member

@blink1073 blink1073 commented Sep 13, 2019

@Madhu94
Copy link
Collaborator Author

@Madhu94 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
Collaborator Author

@Madhu94 Madhu94 commented Sep 14, 2019

Some references - original proposal and recent status update

@blink1073
Copy link
Member

@blink1073 blink1073 commented Sep 16, 2019

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

@Madhu94
Copy link
Collaborator Author

@Madhu94 Madhu94 commented Sep 16, 2019

Yeah, ready for review/merge

@blink1073
Copy link
Member

@blink1073 blink1073 commented Sep 16, 2019

Thanks!

@blink1073 blink1073 merged commit 6bc9df5 into jupyterlab:master Sep 16, 2019
9 checks passed
@jasongrout
Copy link
Contributor

@jasongrout jasongrout commented Sep 18, 2019

@meeseeksdev backport to 1.x

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

Backport PR #7202 on branch 1.x (Allow different mimetypes for the clipboard data)
@jasongrout jasongrout removed this from the 1.2 milestone Oct 11, 2019
@jasongrout jasongrout added this to the 2.0 milestone Oct 11, 2019
@lock lock bot added the status:resolved-locked 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants