-
- Notifications
You must be signed in to change notification settings - Fork 625
Description
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 documentin 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.