Describe the bug
After an upgrade to the last chrome version, the execCommand break the copy during the Copy/Paste action.
Maybe now deprecated function now on Chrome, still work on Firefox i think.
Your environment details
- Device: Desktop
- OS: Linux
- Browser Chrome 134
Quick find
The handleCopy file use on line 23 and 24: document.execCommand("copy")
The handlePast retrieve it on 14: event.clipboardData.getData("text/html")
Copy could be replace by
If ("clipboard" in navigator)
await navigator.clipboard.writeText(div.innerHTML)
else
document.execCommand("copy")
Past could be replace by the same logic but with:
const data = await navigator.clipboard.readText()
Im not sure about the handlePaste //TODO line and the way it required information from the dom.
But for the else logic, we could maybe use the the readText one.
Describe the bug
After an upgrade to the last chrome version, the
execCommandbreak the copy during theCopy/Pasteaction.Maybe now deprecated function now on Chrome, still work on Firefox i think.
Your environment details
Quick find
The
handleCopyfile use on line 23 and 24:document.execCommand("copy")The
handlePastretrieve it on 14:event.clipboardData.getData("text/html")Copy could be replace by
Past could be replace by the same logic but with:
Im not sure about the
handlePaste//TODO lineand the way it required information from the dom.But for the
elselogic, we could maybe use the thereadTextone.