-
Notifications
You must be signed in to change notification settings - Fork 39
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
document.execCommand()
should do nothing when the document is invisible
#193
Comments
Ccing @travisleithead, @rniwa and @garykac. |
What do you by invisible though? Outside of the viewport? Occluded by other elements? We don't load iframe that's |
^ Also add |
I tried just |
For this reason it seems like a bad idea to turn this off. At the same time, it should be noted that there are 0 (zero) occurrences of the browser's [1] https://github.com/codemirror/CodeMirror/search?p=2&q=execCommand&unscoped_q=execCommand |
Ah, I was referring more to the fact that many editors out there use hidden contenteditable areas to override and customize editing behavior (citing CodeMirror and Google Docs as examples).
I think Google Docs would surely use |
That's also how I understood your comment. I just wanted to make sure that no-one read this thread and got the impression that
Clipboard actions are known to have required |
When we're investigating Mozilla's crash bug, I found a incompatible issue between browsers. When web apps does
execCommand("insertText", false, "foo")
in invisible<iframe>
, Firefox and Chrome do nothing. However, Safari and Edge oddly they acceptexecCommand
and inputs from user into the hidden document.testcase: https://jsfiddle.net/d_toybox/edzpr9h3/9/
I think that browsers shouldn't accept any input including
execCommand()
in invisible document since it might try to steal user input. I.e., I think that the behavior of Firefox and Chrome is better.The text was updated successfully, but these errors were encountered: