Live data from Hacker News

Google is considering removing alert()

twitter.com

11–20 of 41 posts

Re: Google is considering removing alert()

#11
post #5

Earlier quoted context omitted.

There is no place for an out of dom signalling mechanism like alert() on the modern web. I would hope to see a multi-year phase out of something this integral. I can't remember the last time I saw it used for something useful.

deprecation is totally fine, log a warning in the console, discourage people from using it, but don't throw the existing web under a bus because your UX team can't think of a nice way to visually distinguish it from the browser's chrome!

> can't think of a nice way to visually distinguish it from the browser's chrome

i don't think it's about visual design. Having a signalling mechanism that lives outside of the dom is confusing to users, and alert is a rare exception from wayyyy back when. It looks like google is doing this for user security, and I support it.

I don't support the way they're going about it. If Mozilla and Microsoft and W3C are willing to get on board, I would greatly support it. But this is more throwing their weight around, and it sucks!

>existing web

i'm gonna be honest, i havent seen a meaningful alert be used in recent memory, and i work with a lot of web apps. All alert()s could be easily replaced with something inline. I'm not a huge fan of breaking changes, but this is one (with a multi year rollout) that I would support.

Re: Google is considering removing alert()

#13
post #5

Earlier quoted context omitted.

deprecation is totally fine, log a warning in the console, discourage people from using it, but don't throw the existing web under a bus because your UX team can't think of a nice way to visually distinguish it from the browser's chrome!

> can't think of a nice way to visually distinguish it from the browser's chrome i don't think it's about visual design. Having a signalling mechanism that lives outside of the dom is confusing to users, and alert is a rare exception from wayyyy back when. It looks like google is doing this for user security, and I support it. I don't support the way they're going about it. If Mozilla and Microsoft and W3C are willin…

It isn't uncommon for me to find a site that uses it legitimately. Sometimes for telling the user info, sometimes for reporting an error, and sometimes for other goals. Sure, it'd be better if they did it in a more normal manner (writing their message into an HTML paragraph), but they do use it. But a lot of these sites are dead (though some aren't) and so it for the most part doesn't matter if you remove it now or after three years. They'll still break or lose functionality. Just spit out a warning to the dev console when it is used.

Re: Google is considering removing alert()

#14
post #5

Earlier quoted context omitted.

There is no place for an out of dom signalling mechanism like alert() on the modern web. I would hope to see a multi-year phase out of something this integral. I can't remember the last time I saw it used for something useful.

deprecation is totally fine, log a warning in the console, discourage people from using it, but don't throw the existing web under a bus because your UX team can't think of a nice way to visually distinguish it from the browser's chrome!

Pretty sure it's a different problem - alert() is a true modal dialog that blocks almost all other normal interactions and is very disruptive. Back in the day when apps weren't constantly gaming all user interactions to squeeze on extra ad click out or whatever, it was still abused - but rarely.

Now if you wander down the wrong internet 'alley' you'll get mugged by someone using alert() to almost completely hijack your normal session. Especially for older folks (my grandpa really suffered from this), it becomes impossible - to the point they'll even call someone up and give them their credit card number sometimes so they can 'get to their email'.

Warnings to the dev console won't stop this type of harassment of users - only stopping it from being the modal dialog it is supposed to be (per alert() prior behavior) will.

Re: Google is considering removing alert()

#16
post #5

Earlier quoted context omitted.

deprecation is totally fine, log a warning in the console, discourage people from using it, but don't throw the existing web under a bus because your UX team can't think of a nice way to visually distinguish it from the browser's chrome!

> can't think of a nice way to visually distinguish it from the browser's chrome i don't think it's about visual design. Having a signalling mechanism that lives outside of the dom is confusing to users, and alert is a rare exception from wayyyy back when. It looks like google is doing this for user security, and I support it. I don't support the way they're going about it. If Mozilla and Microsoft and W3C are willin…

>i'm gonna be honest, i havent seen a meaningful alert be used in recent memory, and i work with a lot of web apps.

I see them used very often to indicate unsaved changes when a user leaves a page.

Re: Google is considering removing alert()

#17

No. They are not. They are considering disabling it for cross-origin alerts from iframes. https://twitter.com/estark37/status/1422694845076762629?s=21 Everything else is speculation. It may even be likely speculation! But it is speculation nonetheless.

Yes they are, and within a few months, Google will continue fucking over the web. They are explicitly saying there will be breakage because "wah wah it's on the main thread".

https://twitter.com/estark37/status/1422694855390629893

Re: Google is considering removing alert()

#18
post #14
post #5

Earlier quoted context omitted.

deprecation is totally fine, log a warning in the console, discourage people from using it, but don't throw the existing web under a bus because your UX team can't think of a nice way to visually distinguish it from the browser's chrome!

Pretty sure it's a different problem - alert() is a true modal dialog that blocks almost all other normal interactions and is very disruptive. Back in the day when apps weren't constantly gaming all user interactions to squeeze on extra ad click out or whatever, it was still abused - but rarely. Now if you wander down the wrong internet 'alley' you'll get mugged by someone using alert() to almost completely hijack yo…

Every major web browser has implemented a "do not show alerts from this site anymore" checkbox that appears after 2-3 consecutive alerts.

"Protecting the users" is an absolute lie.

Re: Google is considering removing alert()

#19
post #5

Earlier quoted context omitted.

deprecation is totally fine, log a warning in the console, discourage people from using it, but don't throw the existing web under a bus because your UX team can't think of a nice way to visually distinguish it from the browser's chrome!

> can't think of a nice way to visually distinguish it from the browser's chrome i don't think it's about visual design. Having a signalling mechanism that lives outside of the dom is confusing to users, and alert is a rare exception from wayyyy back when. It looks like google is doing this for user security, and I support it. I don't support the way they're going about it. If Mozilla and Microsoft and W3C are willin…

The UX issue is directly highlighted in their rationale for the change.

Calls to alert(), confirm() and prompt() cannot be polyfilled or safely replaced in the general case because they explicitly block the main thread. That behaviour might not be desirable, but it was the path chosen when the relevant code was written. While some maintained applications will be able to switch to asynchronous alternatives, many older and unmaintained websites - the long tail of the web, will stop working.

Re: Google is considering removing alert()

#20
post #16

Earlier quoted context omitted.

> can't think of a nice way to visually distinguish it from the browser's chrome i don't think it's about visual design. Having a signalling mechanism that lives outside of the dom is confusing to users, and alert is a rare exception from wayyyy back when. It looks like google is doing this for user security, and I support it. I don't support the way they're going about it. If Mozilla and Microsoft and W3C are willin…

>i'm gonna be honest, i havent seen a meaningful alert be used in recent memory, and i work with a lot of web apps. I see them used very often to indicate unsaved changes when a user leaves a page.

Isnt that confirm()
Post reply on HN