Open Bug 315415 Opened 17 years ago Updated 4 years ago

onbeforeunload dialog displayed when handler returns undefined (was: Error 'undefined' with Firefox 1.4+)

Categories

(Core :: DOM: Events, defect, P5)

x86
Windows 2000
defect

Tracking

()

People

(Reporter: powers.jason, Unassigned)

References

Details

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051025 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051025 Firefox/1.5

So I've got 150 machines on this network, and we use (internally) a site based on zope/plone for documentation and ticket tracking. It works very well with Firefox up to 1.0.7, but the betas and now the release candidate for 1.5 have a problem navigating from page to page.

The web site link is internal to our company, so it'll be tough for anyone here to see. I've placed the image of the error online though: http://www.numinae.com/undefined.png

I go to one page on the website with a (normal, well-formed) link to the server. The page provides normal links to other pages. When I click a link to go to another page I get the error I linked above:

"Are you sure you want to navigate away from this page?

Error: undefined

Press Ok to continue, or Cancel to stay on the current page."

Reproducible: Always

Steps to Reproduce:
1. Go to plone site rewritten by apache
2. click on a link to another page on the site

Actual Results:  
"Are you sure you want to navigate away from this page?

Error: undefined

Press Ok to continue, or Cancel to stay on the current page."

Expected Results:  
Goes to next page without complaint

I can't reproduce it by going to plone.org or zope.org, which uses the same software. I'm wondering why the error detail is so generic.
For your review. As far as I know, zope/plone generates valid xhtml, and is tested thoroughly under firefox, so it's surprising to see this in mozilla rather than IE. I don't know enough about those urls to know if there's javascript involved.
The image shows the confirmation dialog that appears when a page registers a 'beforeunload' event handler. This event wasn't supported in 1.0.x, that's why you didn't see it before. 
Yeah, but every time I change the page this pops up. If this behavior was intentional, should there be a 'do not show me this message in the future' check box?
The dialog is modeled after IE, which doesn't have such a checkbox. However, could you check through the JavaScript files looking for the beforeunload handler? I believe there is an incompatibility with IE here that should be adressed: if the handler sets 'event.returnValue' to undefined, Firefox shows the dialog, IE does not.
Attached file testcase
This should not show the confirmation dialog.
Assignee: nobody → events
Component: General → DOM: Events
Product: Firefox → Core
QA Contact: general → ian
Summary: Error 'undefined' with Firefox 1.4+ → onbeforeunload dialog displayed when handler returns undefined (was: Error 'undefined' with Firefox 1.4+)
Version: unspecified → Trunk
>The dialog is modeled after IE

And that's the problem.
(In reply to comment #6)
> Created an attachment (id=202217) [edit]
> testcase
> 
> This should not show the confirmation dialog.
> 

Except that it does.
IE behaviour is defined here: http://msdn2.microsoft.com/en-us/library/ms536907.aspx

Standards do not help here, as AFAICS only HTML5 defines onbeforeunload with no details about how to skip the dialog ATM.
Assignee: events → nobody
QA Contact: ian → events
Behaviour changed after bug 588292 fix
Status: UNCONFIRMED → NEW
Ever confirmed: true
Blocks: 588292
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.