Skip to content

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

Open

Description

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

browser:chromeThe issue can only be reproduced in the Chrome browser.The issue can only be reproduced in the Chrome browser.status:confirmedAn issue confirmed by the development team.An issue confirmed by the development team.type:featureA feature request.A feature request.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions