Setting `text/html` via 'dataTransfer.setData' results in invalid data format in clipboard

Fixed Issue #14372529

Details

Author
Krzysztof K.
Created
Oct 25, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
16.16257
Reports
Reported by 5 people

Sign in to watch or report this issue.

Steps to reproduce

When HTML is copied with e.g. CTRL + C the data put inside clipboard contains special HTML format which is easily recognized by other applications (e.g. browsers), like:

Version:1.0
StartHTML:000000195
EndHTML:000001453
StartFragment:000000227
EndFragment:000001421
SourceURL:https://s.codepen.io/boomerang/iFrameKey-3b5d5cf9-7c50-52e1-38d3-8d96f2f85971/index.html
<html><body><!--StartFragment-->Copied HTML...<!--EndFragment--></body></html>

However, when clipboard data is set manually on copy, the clipboard data contains only set value without HTML specific wrapper:

Scenario:

  1. Go to https://codepen.io/f1ames/pen/MEMRxN?editors=1010.
  2. Copy HTML or its part from the div.

Expected:
Clipboard contains <p>this paragraph contains <strong>some text</strong></p> HTML string wrapped in HTML specific wrapper.

Actual:
Clipboard contains only <p>this paragraph contains <strong>some text</strong></p> HTML string.

This behaviour is quite painful as such HTML clipboard data is not properly recognized by other browsers (Chrome/FF) so it cannot be pasted there.

Attachments

2 attachments

Comments and activity

  • Works in Chrome and FF where manually set text/html data is properly wrapped.

  • Microsoft Edge Team

    Changed Assigned To to “James M.”

  • Hello,

    Thank you for providing this information about the issue. After thorough testing, we are unable to reproduce this problem in Edge with the information at hand. We find Edge and Firefox copy the expected content, but Chrome drops the paragraph tags (<p>). Screenshots attached.

    Please update this case when you can provide more details, such as screenshots or video capture of your repro to ensure we are following the correct steps.

    Best Wishes,
    The MS Edge Team

  • I uploaded the video showing how the behaviour differs for regular copy/paste and copy/paste with manually set text/html in Edge and Chrome (00:00 to 01:10).
    The second part (01:11 to 01:59) shows that it is not possible to paste content set manually in Edge to Chrome (while regular copy/paste works fine).

  • Uploaded the file to dropbox as it was too large to be put here: https://www.dropbox.com/s/vgmdzjjv4w6f3zt/repro-steps.mov?dl=0

  • Microsoft Edge Team

    Changed Status to “Fixed”

  • Hello,

    Thank you for providing this information about the issue. We are pleased to report this feature is fixed in Edge 17017 and is available in our latest Insider Preview build in the Fast ring.

    Best Wishes,
    The MS Edge Team

  • Thanks James, glad to hear that!

    Could you tell me when the Edge 17017 preview will be more widely available (e.g. on modern.ie) so I can verify the fix?

You need to sign in to your Microsoft account to add a comment.

Sign in