Skip to content
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

Find alternatives for document.execCommand #97

Open
threema-danilo opened this issue Feb 28, 2022 · 0 comments
Open

Find alternatives for document.execCommand #97

threema-danilo opened this issue Feb 28, 2022 · 0 comments

Comments

@threema-danilo
Copy link
Contributor

From https://developer.mozilla.org/en-US/docs/Web/API/document/execCommand:

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

On the other hand, there's no clear replacement: https://stackoverflow.com/questions/61520602/is-there-a-replacement-for-document-execcommand-or-is-it-safe-to-use-document

I don't assume the execCommand API will stop working anytime soon, but we should still take a look at our options.

The https://w3c.github.io/input-events/ spec may be an alternative to some use cases (e.g. stripping formatting on paste), but not all (e.g. inserting emoji HTML snippets). And the implementation https://github.com/w3c/input-events/ seems a bit stalled. Maybe some issues could be pinged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants
@threema-danilo and others