Performance of navigator.clipboard.write vs event.clipboardData.setData

Viewed 177

In testing out the following two copy-to-clipboard actions:

event.clipboardData.setData('text/html', html);

And:

navigator.clipboard.write(new ClipboardItem({"text/html": new Blob([html], {type: "text/html"})

The first method is literally about 100x faster when trying to copy the same data. Is there a reason why one is so much faster than the other? Is there any way to achieve closer-to-parity between them?

References for both found here.

0 Answers
Related