Re:Implement window.{alert, prompt, confirm} removal from cr...
by merb on Tuesday August 03, 2021 @07:40PM
(#28055614)
repl.it which uses an iframe and it might be good to showcase prompt
[ Parent
| on HN ]
Re:Implement window.{alert, prompt, confirm} removal from cr...
by protoduction on Tuesday August 03, 2021 @08:55PM
(#28056066)
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).
Re:Implement window.{alert, prompt, confirm} removal from cr...
by TheRealPomax on Tuesday August 03, 2021 @07:59PM
(#28055751)
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.
Re:Implement window.{alert, prompt, confirm} removal from cr...
by shakna on Tuesday August 03, 2021 @09:52PM
(#28056378)
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.