Live data from Hacker News

Ask HN: Why do browsers still support pop up dialogs and other bad behavior?

news.ycombinator.com

41–50 of 84 posts

Re: Ask HN: Why do browsers still support pop up dialogs and other bad behavior?

#41
I don't have the answer but it seems like 90 percent of these could be solved with a button on the browser (possibly in a drop down menu) that kills a tab NO MATTER WHAT. Basically a force quit / kill -9 for a tab.

I don't see how any of the "excuses" in other people's comments would preclude something like that allowing people to easily escape an evil site like you describe.

Re: Ask HN: Why do browsers still support pop up dialogs and other bad behavior?

#42
post #13

Pages rely on window.open() for all sorts of non-popup things. You can't just break window.open(), or sites like DDG will stop working. Not that there aren't ways to fix this, but in general "remove the offending API" rarely works on the Web. You need a more subtle approach.

I think OP is rather talking about window.{alert,prompt,confirm}, at least "ie, you can't interact with the page without answering the dialog" hints towards that

That's tricky too. You can't just remove window.prompt, or users won't be able to use pages that rely on it for critical input. So what do you do? window.prompt is a synchronous API; you have to return something to the code that called it. You might say "well, just suspend that function and let the user interact with the rest of the page". But by doing that you've introduced coroutines to JavaScript (since "interacting with the rest of the page" means "running JS"), which is a huge change that comes with a mountain of tricky interactions. Even if it could be made to work (which most browser vendors think is impossible), it would still break pages that didn't expect random state to change across the window.prompt call.

Re: Ask HN: Why do browsers still support pop up dialogs and other bad behavior?

#43
post #29

> There are also sites that will kill your page history by going through a bunch of redirects to prevent you from leaving with the back button. It's 2016 and Microsoft is incapable of creating a reliable cross-site login system. Instead, we still have the disastrous mess that is live.com. Minimum 2 redirects - at least 1 of which is Javascript (seriously?) - to handle a simple login. And when your cookies go a bit wo…

Flying Spaghetti Monster help you if you have both a personal and an organizational (Office 365) Microsoft account with the same email address.

For those of you who don't know, the process basically goes like this:

Input your email / password -> select if you want to use your personal or business profile -> enter your login info again (because, reasons) -> go through two redirects.

Re: Ask HN: Why do browsers still support pop up dialogs and other bad behavior?

#45
post #16

The fact that people make bad things with features doesn’t mean these features are inherently bad. You’ll always have people abusing the technology. Pop up dialogs are used a lot for e.g. form validation.

Preventing the bad things may easily be more valuable to users than keeping/enabling the good things made possibly by that tech.

Most browsers now let you stop alerts from a website, thus avoiding the `while (true) { alert(…); }` variants.

Re: Ask HN: Why do browsers still support pop up dialogs and other bad behavior?

#46
A major issue I haven't seen mentioned below is that for auth things like paypal or other logins you need to show the root security context is from the site you are authenticating to. You can do that by either moving the whole window to the login page, which can be jarring and cause users to be confused, or you can do a popup. Some sites choose one, some choose the other. When you have active things going on on the first site, it really causes the drive to a popup.

Re: Ask HN: Why do browsers still support pop up dialogs and other bad behavior?

#47

I sometimes wonder how nice life would be if we had two modes in browsers: Mode 1: Render static content; allow unobtrusive JavaScript operations (perhaps capped by total operations or CPU usage). Mode 2: Run unlimited JS operations, allow alert() and window.onbeforeunload events handers. The second mode could be called "Application Mode" and could be turned on selectively per site. This would allow you to give gmail…

I just keep Javascript turned off except for sites I whitelist. Nobody ever believes how easy and unobtrusive this is, despite browsing a pretty huge and diverse set of domains. This has gotten a little more difficult since chrome changed the UI around these settings though.

I use uMatrix on Chrome and only allow certain things to run on various pages, to only render the content I want.

Re: Ask HN: Why do browsers still support pop up dialogs and other bad behavior?

#48

Earlier quoted context omitted.

The most common use for onwindowunload dialog boxes is to warn the user of unsaved changes and prevent their loss. Our web app autosaves so the dialog box should never appear, but our metrics show that it appears surprisingly often -- sometimes it can take a few seconds for changes to flush through the websocket, and for the save to get acknowledged. If you took that away, our users would lose changes. I imagine they…

If this is absolutely necessary, you can force the site to request permission to do this, just like getting location.

How about making it 'harder' for the user to close the browser when there is an alert being shown by a website ? For instance, if google docs throws an alert about the data not being saved, your browser could throw you a msgbox notifying you that such tab has an alert you haven't dealt with when you try to close it.

Yes, that's a lot of msgboxes, but it's a decent compromise I think. It's not like that would happen very often anyway.

Re: Ask HN: Why do browsers still support pop up dialogs and other bad behavior?

#49

Earlier quoted context omitted.

>Depending on the design and the requirements of an application modal dialogues and in rare cases even disabling leaving via the back button absolutely make sense. Sorry, I disagree with you. On a typical non-web application, a modal dialog doesn't prevent me from accessing other applications. It doesn't prevent me from forcefully killing crapware either. The idea that web applications should be able to break user ex…

Disabling the back button can be very useful in certain scenarios. Sometimes you want to prevent users from shooting themselves in the foot, for example when submitting a credit card payment. Even though there are prominent "please do not use the back button!" warnings, a lot of users still do, resulting in double-charging. So clearly there are scenarios where the default behavior can be sub-optimal and you need to o…

That is an indicator of a seriously outdated form implementation.

Re: Ask HN: Why do browsers still support pop up dialogs and other bad behavior?

#50
post #3

Safari has actually changed behaviour so alert/prompt/confirm dialogs are not modal outside of the tab - you can switch to other tabs and I believe even close the window/tab. They've also been restyled to make it obvious they're a prompt from the website not from safari itself. Also, there are legitimate uses for this functionality, so as with many things I think the solution is not to remove the functionality, just…

> Safari has actually changed behaviour so alert/prompt/confirm dialogs are not modal outside of the tab - you can switch to other tabs and I believe even close the window/tab. Firefox does this too.

Chrome did this when it originally shipped, by rendering each tab in its own Windows desktop (in the same way that the lock screen is a separate desktop). For some reason they removed that functionality, and dialogs are now modal across all tabs.
Post reply on HN