Hacker News new | ask | show | jobs
by merb 1785 days ago
repl.it which uses an iframe and it might be good to showcase prompt
2 comments

I'm building https://starboard.gg, it has the same issue. The iframe is important for sandboxing user code, and alert is often used in tutorials (despite being bad practice, it's intuitive for beginners).
It'd hardly be even minor effort for the repl.it folks to just include a file in their sandbox loader that gives folks a normal, modern modal when some JS contains prompt() or confirm().

Remember: it's not about whether it's useful, it's about whether there isn't a better way to do it, because it's useful. In this case: yeah, absolute. There are way better ways.

prompt & confirm are native, and so automatically and correctly work with all your accessibility software.

Most "modern" modals struggle to correctly inform a screenreader, let alone all the other accessibility tools.

So yes, I would say that 'confirm' is a far better way of doing it.