Re:Google is considering removing alert()
by phpnode on Wednesday August 04, 2021 @03:22PM
(#28065086)
They are planning to deprecate them from the platform entirely, this is the first step
[ Parent
| on HN ]
Re:Google is considering removing alert()
by torstenvl on Wednesday August 04, 2021 @05:30PM
(#28066613)
Please provide a link, or stop passing speculation off as truth.
Re:Google is considering removing alert()
by phpnode on Wednesday August 04, 2021 @05:42PM
(#28066764)
Tweets from Google employees who work on chrome:
https://twitter.com/estark37/status/1422694855390629893
https://twitter.com/domenic/status/1422647331804037120
Re:Google is considering removing alert()
by torstenvl on Wednesday August 04, 2021 @05:44PM
(#28066784)
Those links contradict your assertion, instead indicating a move to "non-blocking alert()"
Re:Google is considering removing alert()
by danShumway on Thursday August 05, 2021 @11:01AM
(#28074688)
From those links:
> Yeah, I think the most likely eventual "removal" path is actually non-blocking alert(). (confirm() and prompt() cannot be converted to non-blocking though, so they'd have to be fully removed)
Blocking Javascript execution is a fundamental part of the `alert` spec. Replacing it with a different, non-JS-blocking thing that happens to share the same name doesn't mean that `alert` wouldn't be removed as it exists today.
And there's just no way at all to make `prompt`/`confirm` non-blocking, they have to block the main JS thread in order to keep the same API.
Re:Google is considering removing alert()
by phpnode on Wednesday August 04, 2021 @05:52PM
(#28066869)
That breaks the web by definition. There is no way to implement a non-blocking alert(), confirm(), or prompt() in a way that doesn't break existing code that uses them, and that's a lot of code, a lot of the web.
Re:Google is considering removing alert()
by zozbot234 on Wednesday August 04, 2021 @06:15PM
(#28067141)
It can block JavaScript execution on the page for compatibility with existing code, while leaving normal browsing unaffected otherwise.
Re:Google is considering removing alert()
by phpnode on Wednesday August 04, 2021 @06:36PM
(#28067345)
the alert(), confirm(), and prompt() themselves interrupt normal browsing, so I'm not sure what you mean here. They're synchronous so block the main thread, but they also block other user interactions until they're dismissed, so what would be the benefit in leaving normal browsing unaffected if the user cannot browse anyway?