Replace usage of native alert/confirm/prompt
with web content versions
#33937
Labels
Browser Issues
Issues or PRs that are related to browser specific problems
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
Major browsers - starting with Chrome - will soon restrict the
alert/confirm/prompt
functions from being used from within cross-origin iframes. They started deprecating the usage of these functions in the cross-origin iframe contexts, but the intent, it seems, is to completely remove them eventually.The trial to prevent cross-origin iframes to trigger these functions was supposed to be active, meaning it shouldn't work anymore in Chrome 92 up to 96. It might have been delayed for now (though I haven't tested it at the time I write this), but they're sticking to it.
This might not seem relevant to Gutenberg, but some applications do use the editor from an iframe. Here's a real-world example of such an issue.
However - and this is directly relevant to Gutenberg when used outside of an iframe context - It's possible that after disabling the cross-origin iframe use cases, these functions will be removed completely. It might take a good while, but the odds are it'll eventually happen.
What is your proposed solution?
Replace these functions with our own versions that implement similar functionality using web contents (DOM and CSS through React components).
Further reading:
The text was updated successfully, but these errors were encountered: