Open Bug 448493 Opened 16 years ago Updated 2 years ago

onbeforeunload is invoked twice when POSTDATA expiration confirm dialog is shown

Categories

(Firefox :: General, defect)

5 Branch
x86
Windows XP
defect

Tracking

()

UNCONFIRMED

People

(Reporter: jiayephy, Unassigned)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16

It seems that the appearance of POSTDATA expiration warning dialog causes the window.onbeforeunload event handle of current page invoked twice.

I'll post the test case for reproduce this bug as an attachment later.

Reproducible: Always

Steps to Reproduce:
Running this reproduce case needs PHP environment.

1. Extract the two php files to a PHP working directory.
2. Load page "a.php" (say page A) in Firefox (say "http://localhost/a.php").
3. Click "Submit" button on the page.
4. It goes to page "b.php" (say page B).
5. Click "Submit" button on page B.
6. It goes to page A.
7. Click the back navigation button of Firefox.
8. It invokes the window.onbeforeunload event handle and opens a confirm dialog with message "Do you really want to leave page A?".
9. Click OK to confirm.
10. It opens another confirm dialog for POSTDATA expiration.
11. Click OK to confirm.
12. It opens the confirm dialog shown in step 8 again.

Actual Results:  
See reproducing steps.

Expected Results:  
The step 12 in the reproducing steps should not happen.

This bug is tested and appears under:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070216 Firefox/1.5.0.10

This bug doesn't appear under:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
Attached file reproducing test case
See the reproducing steps for how to use it.
Reporter -> Are you still experiencing this issue with the latest version of Firefox 3.6.13? Does the issue occur with the latest nightly? http://nightly.mozilla.org/
Version: unspecified → 2.0 Branch
I just test it again on 3.6.13 on Windows. I remains seem.

An interesting thing is: 3.0.1 doesn't suffer this problem (see my original report).

Version I just tested on: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 BTRS35926 Firefox/3.6.13 (.NET CLR 3.5.30729)

I don't have a nightly version by my hand.
Version: 2.0 Branch → 3.6 Branch
Reporter -> Are you still experiencing this issue with the latest version of Firefox 5?
Jia -> Are you still experiencing this issue with the latest version of Firefox 5?
(In reply to Tim (fmdeveloper) from comment #6)
> Jia -> Are you still experiencing this issue with the latest version of
> Firefox 5?

Yes. On Firefox 5.0.1 on Mac OS X 10.6.8.

I've given a reproduce case 3 years ago. You can test it by yourself.
Version: 3.6 Branch → 5 Branch
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: