ckeditor4 icon indicating copy to clipboard operation
ckeditor4 copied to clipboard

Check if pastebin can't be added always to `body`

Open Comandeer opened this issue 3 years ago • 1 comments

Type of report

Task

Provide description of the task

Currently, we have a logic that checks the browser and decides if the pastebin should be added to the body or directly to the html → https://github.com/ckeditor/ckeditor4/blob/fa13662204391343ed0f418f9455dc9b501f6012/plugins/clipboard/plugin.js#L1117

However, the logic adds the pastebin to the html element only in Firefox, in every other browser the pastebin is inserted into the body. We should investigate if we can remove that logic and always insert the pastebin into the body. Especially that editables outside of body are known to cause issues.

Connected issues:

  • https://bugzilla.mozilla.org/show_bug.cgi?id=1722535
  • w3c/editing#405

Other details

  • Browser: Firefox
  • OS: N/A
  • CKEditor version: 4+
  • Installed CKEditor plugins: clipboard

Comandeer avatar Aug 10 '22 10:08 Comandeer

Connected: #1169.

From my quick tests, it seems that the pastebin is not used in the Firefox at all, so probably the whole logic can be simply replaced with:

editable.getAscendant( 'body', 1 ).append( pastebin ); 

Comandeer avatar Aug 10 '22 10:08 Comandeer