We have an issue where we are trying to bind the beforeunload to the window to prompt the user with a "Leave or Stay" message. If the user doesn't click or press a key, they are able to close the browser without a prompt. However, if they do click or press a key, they do get the message.
Is there a way to make the prompt appear even if the user has not yet taken action on the window? Or is this a security block that is browser specific?
Unable to prompt user with leave or stay message
-
- Posts: 2
- Joined: July 25th, 2017, 1:08 pm
- DanRaisch
- Moderator
- Posts: 127231
- Joined: September 23rd, 2004, 8:57 pm
- Location: Somewhere on the right coast
Re: Unable to prompt user with leave or stay message
No bug here. Moving to Web Development.
-
- Posts: 2
- Joined: July 25th, 2017, 1:08 pm
Re: Unable to prompt user with leave or stay message
I considered this a bug because in every other major browser (IE, Safari, Chrome) this behavior is the same - bindings happen instantly, but Firefox does not.
- Frenzie
- Posts: 2135
- Joined: May 5th, 2004, 10:40 am
- Location: Belgium
- Contact:
Re: Unable to prompt user with leave or stay message
You didn't post any code so there's no way to tell one way or the other.
https://developer.mozilla.org/en-US/doc ... nloadEvent
https://developer.mozilla.org/en-US/doc ... nloadEvent
Intelligent alien life does exist, otherwise they would have contacted us.