ckeditor4
ckeditor4 copied to clipboard
Restrict 'pastebin' usage in widgets plugin only for browsers which really utilizes it
Are you reporting a feature request or a bug?
Task
Check if the issue is already reported
Extracted from #1160.
Provide detailed reproduction steps (if any)
See https://github.com/ckeditor/ckeditor-dev/issues/1160#issuecomment-344580238 for wider context.
The clipboard plugin uses pastebin only for browsers not supporting Clipboard API (IE browsers), but for widgets it is used always. I think we should consider restricting its usage only from browsers which really needs it, especially that:
-
copySingleWidgetis called first and it utilizesCKEDITOR.editable.getHtmlFromRangeto prepare HTML which is copied by the browser to a clipboard/dataTransfer. -
clipboardplugin listeners are executed, which for browsers supporting Clipboard API, createsCKEDITOR.plugins.clipboard.dataTransfer. -
CKEDITOR.plugins.clipboard.dataTransferobject upon creation insertstext/htmldata to clipboard (usingCKEDITOR.editor.getSelectedHtml) overwriting html which was inserted viapastebin.
Also CKEDITOR.editable.getHtmlFromRange is the base of the CKEDITOR.editor.getSelectedHtml method so the output should is the same.
Other details
- Browser: All
- OS: All
- CKEditor version:
- Installed CKEditor plugins:
clipboard,widgets
I wasn't able to activate pastebin in non-IE browsers. It'd be good to check if the issue is still present.