MozillaZine

Unable to prompt user with leave or stay message

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
tjosephp
 
Posts: 2
Joined: July 25th, 2017, 1:08 pm

Post Posted July 26th, 2017, 5:57 am

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?

DanRaisch
Moderator

User avatar
 
Posts: 118008
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Post Posted July 26th, 2017, 6:34 am

No bug here. Moving to Web Development.

tjosephp
 
Posts: 2
Joined: July 25th, 2017, 1:08 pm

Post Posted July 26th, 2017, 2:23 pm

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

User avatar
 
Posts: 2110
Joined: May 5th, 2004, 10:40 am
Location: Belgium

Post Posted July 31st, 2017, 12:38 am

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
Intelligent alien life does exist, otherwise they would have contacted us.

Return to Web Development / Standards Evangelism


Who is online

Users browsing this forum: No registered users and 1 guest