Instead of returning immediately does it make sense to have a Promise here? Otherwise won't any data transmitted to the prompt be lost in a background tab since the alert is shown after the call has returned?
> Instead of returning immediately does it make sense to have a Promise here?
No for two reasons.
First is that the spec can't change. This is a legacy API; we're trying to make it behave better within the existing spec.
Second, alert() returns no useful data. You're likely thinking of confirm().
> Otherwise won't any data transmitted to the prompt be lost in a background tab since the alert is shown after the call has returned?
alert() returns no useful data, so that's not a concern.
Comment 1 by a...@chromium.org
, Jul 21 2017