Lots of pages have alerts when you leave them: if you close tabs, navigate away without saving, etc, there are numerous reasons why a site would alert/block you from leaving until you confirm an alert, e.g. "Are you sure you want to navigate away from this page?".
This is typically done with the onbeforeunload
and/or onunload
handlers.
Here is an example.
Is there any way that I can prevent alerts/user-blocking events generated by those handlers? Basically, I'd like to leave JS enabled, and specifically disallow things that would prevent me from leaving a page without an extra click from happening.
onbeforeunload
and onunload
handlers should still fire; they just shouldn't be allowed to do things that block the user. That means no alerts, and no operations that take more than a few seconds.
I've found a few plugins that edit/greasemonkey patch the javascript for particular pages, and played with their code a bit to try and make them more universally applicable. However, I'm hoping to find a solution that works on any page that tries to block user exit.
Comments
Post a Comment