I have the following code to copy ~25MB of data to the clipboard:
// star time after populating HTML and Text
const start_time = new Date().getTime();
navigator.clipboard.write([
new ClipboardItem({
"text/html": new Blob([html], {
type: "text/html",
}),
"text/plain": new Blob([text], {
type: "text/plain",
}),
}),
]).then(() => {
// end time after async clipbaord api method is completed
const end_time = new Date().getTime();
console.log("writing to clipboard : DONE in", (end_time - start_time) / 1000, "s");
});
And it takes 45s!
Is there a reason why the clipboard.write(...) takes so long to do? Is there some sort of recommendation for how to improve this, or is this just not meant to copy a lot of data?