ckeditor4 icon indicating copy to clipboard operation
ckeditor4 copied to clipboard

Can CKEditor 4 utilize "text/html support for async clipboard api" that Chrome 86 will implement?

Open spacevoyager78 opened this issue 4 years ago • 1 comments

Hi! I've read that Chrome 86 will implement "text/html support for async clipboard api" as you can see here: https://www.chromestatus.com/feature/5357049665814528 :

The async clipboard api currently does not support the text/html format. This feature adds support for copying and pasting html from the clipboard. The HTML is sanitized when it is read and written to the clipboard. The purpose of HTML for Async Clipboard is to provide access to HTML, a format often used to hold rich text and documents. This could be used by: -Web editors, to copy and paste rich text with images and links. -Remote desktop applications, to synchronize text/html payloads across devices. -Sites with clipboard integration, to supersede existing document.execCommand()’s copy and paste functions.

Can this solve the pasting security issues ("Press Ctrl+V to paste. Your browser doesn‘t support pasting with the toolbar button or context menu option.) if CKEditor 4 would use it?

spacevoyager78 avatar Aug 09 '20 14:08 spacevoyager78

Yes, it could solve them, however not in all browsers supported by CKEditor 4 (e.g. it wouldn't work in any of Internet Explorer versions). Additionally, the whole paste flow in CKEditor 4 is designed to work with clipboard events, which are much different than the new, proposed asynchronous API. It would require creating a de facto new plugin, compatible with the current clipboard one (due to the fact that many other plugins depend on its API), while maintaining the old plugin for some browsers (like, mentioned before, IEs).

On the other hand, it could be a good solution to the issue of extending and maintaining the current paste flow, having different branches for particular browsers. The old plugin wouldn't be further developed (it would only receive bug fixes) and every new feature would land in the new one.

I'm not sure if switching to async clipboard API would be beneficial enough to justify such a move. It definitely requires more research.

Comandeer avatar Aug 09 '20 15:08 Comandeer