onbeforeunload Does Not Use Embedded Text On Return

RESOLVED DUPLICATE of bug 641509

Status

()

Core
General
RESOLVED DUPLICATE of bug 641509
4 years ago
4 years ago

People

(Reporter: Gerry Williams, Unassigned)

Tracking

32 Branch
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0
Build ID: 20140911151253

Steps to reproduce:

Here is the code
<script language="JavaScript">
window.onbeforeunload=function(){return "You are attempting to leave this page."+"\n\n" + "If you have made changes and not saved them they will be lost!";};
</script>



Actual results:

The function returns a default text message ...

This page is asking you to confirm that you want to leave - data you have entered may not be saved.


Expected results:

It should return
"You are attempting to leave this page

f you have made changes and not saved them they will be lost!"

It works in the current version of IE
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 641509
Summary: onbeforeun Does Not Use Embedded Text On Return → onbeforeunload Does Not Use Embedded Text On Return

Comment 2

4 years ago
It seems Facebook shows a message properly on firefox. To reproduce go to your facebook page (if you have one) then type something on the status box. now try to navigate away from the page and it shows a custom message. Anyone know how they do this?
You need to log in before you can comment on or make changes to this bug.