TL;DR No modern browsers use the message.
You can abuse the api with this message so browsers dropped the use of the parameter. Thank you Huangism, lilezek, and James for the below responses.
What is the point of setting the event returnValue in the onbeforeunload
callback if the message never gets set?
The MDN docs here remend that we set this value, and I'm not able to prompt the user without setting this value. However when setting that value I don't see my string in any of the confirmation messages.
Example of chrome dialog
TL;DR No modern browsers use the message.
You can abuse the api with this message so browsers dropped the use of the parameter. Thank you Huangism, lilezek, and James for the below responses.
What is the point of setting the event returnValue in the onbeforeunload
callback if the message never gets set?
The MDN docs here remend that we set this value, and I'm not able to prompt the user without setting this value. However when setting that value I don't see my string in any of the confirmation messages.
Example of chrome dialog
Share Improve this question edited Nov 7, 2017 at 17:58 Emmett Harper asked Jul 13, 2017 at 18:52 Emmett HarperEmmett Harper 2594 silver badges16 bronze badges 2- 1 It used to work in older browsers but modern browsers now do not show the text anymore which I assume is to be more secure? – Huangism Commented Jul 13, 2017 at 18:55
- It was removed because this technique was often used by disreputable sites to scam users. – James Commented Jul 13, 2017 at 19:11
1 Answer
Reset to default 5According to MDN docs:
In some browsers, the return value of the event is displayed in this dialog.
Also, at the end of the MDN documentation, there is a table that shows every browser removed support of custom text.