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 to paste an image from clipboard to Chrome on macOS #505

Open
beatadelura opened this issue Jun 13, 2017 · 3 comments
Open

Allow to paste an image from clipboard to Chrome on macOS #505

beatadelura opened this issue Jun 13, 2017 · 3 comments
Assignees
Labels
browser:chrome The issue can only be reproduced in the Chrome browser. status:confirmed An issue confirmed by the development team. type:feature A feature request.

Comments

@beatadelura
Copy link
Contributor

Are you reporting a feature or a bug?

Feature

The issue is already reported:

http://dev.ckeditor.com/ticket/16908

Details:

What Chrome gives, when I paste a file is DataTransfer (a.k.a. ClipboardData) object with an empty "files" property, but with 2 "items": first with a filename and the second with a file. It means it is possible to get a file from the second "item", on paste.

Unfortunately, when the upload plugin was implemented there was only one item on Chrome and only the first item is handled (see ​https://github.com/ckeditor/ckeditor-dev/blob/685fc7474fab779afe76edcf36011d2fb6bafab8/plugins/clipboard/plugin.js#L2545). If this line will be replaced with a loop it should be possible to get the file.

Note that on Windows pasted file is not available at all.

Also, note that now you do not need try-catch block there since items have a "kind" property which let you check if it is a file or a string.

  • Browser: Chrome
  • OS: macOS
@beatadelura beatadelura added browser:chrome The issue can only be reproduced in the Chrome browser. type:feature A feature request. labels Jun 13, 2017
@beatadelura beatadelura self-assigned this Jun 13, 2017
@mlewand mlewand added the status:confirmed An issue confirmed by the development team. label Jun 14, 2017
@Comandeer
Copy link
Member

After some talking with @mlewand and @beatadelura we decided that the purpose of the ticket should be broaden. The current implementation of pasting images is based on converting them to Data URIs, which is very inefficient in the case of bigger images (it freezes or even crashes a browser).

Therefore we decided to replace the current implementation with the new one, based on Object URIs, which should be far more performant and shouldn't freeze the browser. As it's a bigger task, it will be moved from minor to major release.

@beatadelura
Copy link
Contributor Author

After talking with @Comandeer, we decided to focus on Chrome and Firefox browser. As I noticed current code is working on Edge, so if everything will go fine, there will be also supported by this browser.

@jacekbogdanski
Copy link
Member

Let's check if the ticket is still valid.

@jacekbogdanski jacekbogdanski added resolution:wontfix The issue is valid, however, CKSource does not plan to fix it. and removed resolution:wontfix The issue is valid, however, CKSource does not plan to fix it. labels Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser:chrome The issue can only be reproduced in the Chrome browser. status:confirmed An issue confirmed by the development team. type:feature A feature request.
Projects
None yet
Development

No branches or pull requests

5 participants