Skip to content

Exercises that use alert break site in Chrome #126

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

Closed
dummdidumm opened this issue Dec 13, 2022 · 2 comments
Closed

Exercises that use alert break site in Chrome #126

dummdidumm opened this issue Dec 13, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@dummdidumm
Copy link
Member

A couple of the Svelte tutorials use alert (example: https://learn.svelte.dev/tutorial/event-modifiers). After the alert is shown once, no other alert will show up afterwards. Not sure what's going on here, maybe a result of the "we will remove alert support from iframes" push that Google did some time ago.
Also, the iframe is reloaded after each alert, because the "do we still have contact to the iframe" polling doesn't receive any updates while the alert is shown. Not sure how this can be worked around in a way that no false positives/negatives occur.

@dummdidumm dummdidumm added the bug Something isn't working label Dec 13, 2022
@dummdidumm
Copy link
Member Author

Ok this happens because we reload the iframe in the background while the alert is still visible - this deadlocks the iframe on Chrome for some reason. So we have to fix both of the mentioned issues at the same time.

@dummdidumm
Copy link
Member Author

Unfortunately I had to wrap the alert call in setTimeout - it seems that postMessage itself is async, so calling alert eagerly would result in the message never showing up. Hope that's ok @Rich-Harris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant