-
-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy to Clipboard Error in Firefox #1063
Comments
Awesome, thanks for providing your code! We did notice this was an issue when first implementing copy/paste but couldn't find a workaround at the time (hence why e2e tests for copy/paste on Firefox are disabled), so even if it requires tweaking it's great to have a something to reference for a fix. |
Thanks @luukbox - this workaround works for me. One minor change I needed was to use |
@Dartoxian I tried the same workaroud, but it does not work for me. Is there anything specific you do to make it work? I have something like this
and it still does not work. Thanks a lot |
Sorry, in 0.15.9 that works! |
In the end the workaround seems to be working to paste something, but it is still present when trying to copy from it |
Describe the bug
Firefox does not support the async Clipboard API, causing an error when attempting to copy content from the editor.
To Reproduce
Uncaught (in promise) DOMException: Modifications are not allowed for this document
in the consoleWorkaround
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.
The text was updated successfully, but these errors were encountered: