Open Bug 923774 Opened 11 years ago Updated 2 years ago

"beforeunload" triggered on documents before "close" on browser window

Categories

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

24 Branch
x86_64
Windows 7
defect

Tracking

()

UNCONFIRMED

People

(Reporter: rfstrobel, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0 (Beta/Release)
Build ID: 20130910160258

Steps to reproduce:

Listen for the "beforeunload" event of a document loaded in any browser tab.
Listen for the "close" event of the browser (XUL) window and call preventDefault().


Actual results:

The browser window is successfully prevented from closing, including all tabs.
However, the "beforeunload" event was already triggered on all tab documents.


Expected results:

The "beforeunload" event of inner documents should not be triggered, until all event listeners of "close" have had a chance to cancel the event.

This expected behaviour is analogue to the "quit-application-requested" event, which is processed upon closing the last window, before any inner documents are notified.

Possibly relates issues include #305085, #369955 and #531199
Component: Untriaged → DOM: Events
Product: Firefox → Core
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
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.