Skip to content

Copy / Paste broken on Chrome v134 #509

@Paul-Vandell

Description

@Paul-Vandell

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions