3
When using "window.onbeforeunload" in firefox, it returns only a generic message as per the image below:
Is there any way I can customize this message in a "modal" in firefox?
3
When using "window.onbeforeunload" in firefox, it returns only a generic message as per the image below:
Is there any way I can customize this message in a "modal" in firefox?
1
Unfortunately, nay it is possible to overwrite the default message in Firefox.
The event beforeunload
uses an internal browser method to stop closing/browsing. In the function assigned to the event, you must return a string that will be added to the default browser message. This in all browsers except Firefox, which only displays its own message.
Event documentation on the Mozilla Developer Network: https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload
Documentation in the MSDN: https://msdn.microsoft.com/en-us/library/ms536907(VS.85). aspx
I get it. Thank you.
Browser other questions tagged jquery
You are not signed in. Login or sign up in order to post.
The most you can do is put a simple custom message without formatting or anything (i.e. a string). Everything else is on account of the browser. In the past the sites abused, opening new popups just before they were closed, etc, so today the browsers only give a simple and standardized option, without much freedom to deviate from it.
– mgibsonbr
In Chrome, IE, Safari and Opera, you specify a message like this:
window.onbeforeunload = function() { return 'sua mensagem aqui'; }
– user622