Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
onbeforeunload return value handling is broken #2297
which means that this testcase:
should cancel the event, and hence lead to a beforeunload prompt. That's not how browsers actually behave.
The way Gecko behaves, based on code inspection, is that the "cancel the event" steps happen only if the return vaue is NOT null (and also if the event is an actual BeforeUnloadEvent, for what it's worth).
When this is fixed, please fix the html/webappapis/scripting/events/event-handler-processing-algorithm.html test in web platform tests, which was written based on the current spec text and fails in every browser I've tried it in.
I should note, that based on the results of that test and the behavior of browsers on this testcase:
(which leads to a beforeunload prompt in Firefox, Chrome, and Safari) it sounds like the Gecko behavior of only doing special things here for actual BeforeUnloadEvent instances is not so Gecko-specific.
My understanding from the OP was that the fix for the standard would be to change