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

Is there a reason copyToSystem doesn't accept multiple mime types? #7119

Closed
Madhu94 opened this issue Aug 29, 2019 · 8 comments
Closed

Is there a reason copyToSystem doesn't accept multiple mime types? #7119

Madhu94 opened this issue Aug 29, 2019 · 8 comments
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.

Comments

@Madhu94
Copy link
Contributor

Madhu94 commented Aug 29, 2019

I want to copy an image from an output area (in user/extension land) and couldn't use copyToSystem

Can we have an optional format param for this method that defaults to text ?

@Madhu94 Madhu94 changed the title [Question] Is there a reason copyToSystem doesn't accept multiple mime types? Is there a reason copyToSystem doesn't accept multiple mime types? Aug 29, 2019
@blink1073
Copy link
Member

We used text only because at least one of our supported browsers only allowed text on clipboard events. It could be that this was IE, which we no longer support, and we could offer other types.

@Madhu94
Copy link
Contributor Author

Madhu94 commented Sep 10, 2019

Thanks, shall I make a PR allowing other mime types and possibly allowing mime types ? This can help in the case of fallbacks (e.g. pasting into notepad uses text, but pasting into outlook can use html).

(I do realize I don't actually need this PR for my extension, I can just use the clipboard API myself directly in the extension)

@blink1073
Copy link
Member

I took another look at MDN, it looks like as long as we use text for the data itself, we can add whatever mime types we like.

https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setData

@Madhu94
Copy link
Contributor Author

Madhu94 commented Sep 11, 2019 via email

@blink1073
Copy link
Member

Ah, right. I found myself wishing system copy and paste worked for cells just yesterday...

@Madhu94
Copy link
Contributor Author

Madhu94 commented Sep 11, 2019

Wasn't that feature deliberately left out because we can drag/drop cells across notebooks in lab ?

@blink1073
Copy link
Member

I think we didn't do it because we have our own clipboard that can have more complex data types and didn't know how to rectify the two clipboards cleanly.

@Madhu94
Copy link
Contributor Author

Madhu94 commented Sep 17, 2019

Closed via #7202

@Madhu94 Madhu94 closed this as completed Sep 17, 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 Oct 17, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

No branches or pull requests

2 participants