Skip to content

Copy to Clipboard Error in Firefox #1063

@luukbox

Description

@luukbox

Describe the bug
Firefox does not support the async Clipboard API, causing an error when attempting to copy content from the editor.

To Reproduce

  • Open BlockNote using Firefox
  • Attempt to copy any text from the editor
  • Uncaught (in promise) DOMException: Modifications are not allowed for this document in the console

Workaround
I noticed that createInternalHTMLSerializer and cleanHTMLToMarkdown aren't actually async. Therefore, it seems like selectedFragmentToHTML could be converted to a synchronous function by removing the call to initializeESMDependencies.

In our environment, I was able to do this and tested it successfully with a custom copyToClipboard extension while disabling the default one.

That said, I'm unsure of the exact circumstances when these dependencies are required, or their purpose, so I'm not certain if this is a universally viable solution.

For anyone interested, here is a StackBlitz example demonstrating the workaround.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingprio:highHigh priorityprio:midMedium priority

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions