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

Replace usage of native alert/confirm/prompt with web content versions #33937

Closed
fullofcaffeine opened this issue Aug 6, 2021 · 1 comment · Fixed by #60385
Closed

Replace usage of native alert/confirm/prompt with web content versions #33937

fullofcaffeine opened this issue Aug 6, 2021 · 1 comment · Fixed by #60385
Assignees
Labels
Browser Issues Issues or PRs that are related to browser specific problems [Type] Enhancement A suggestion for improvement.

Comments

@fullofcaffeine
Copy link
Member

fullofcaffeine commented Aug 6, 2021

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:

@Mamaduka
Copy link
Member

Mamaduka commented Aug 7, 2021

Related #16583.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser Issues Issues or PRs that are related to browser specific problems [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants