Skip to main content

Bug Tracker

Side navigation

#14791 closed bug (fixed)

Opened February 13, 2014 12:37PM UTC

Closed March 05, 2014 02:50AM UTC

Triggering beforeunload throws exception

Reported by: fejesjoco Owned by: dmethvin
Priority: low Milestone: 1.11.1/2.1.1
Component: event Version: 1.11.0
Keywords: Cc:
Blocked by: Blocking:
Description

The following code:

$(window).on("beforeunload", function() { return "nooooooo"; });
$(window).triggerHandler("beforeunload");

Result in an error: TypeError: event.originalEvent is undefined

Attachments (0)
Change History (5)

Changed February 13, 2014 02:26PM UTC by fejesjoco comment:1

Changed February 13, 2014 02:34PM UTC by fejesjoco comment:2

I checked out the offending lines, I see there's some kind of magic converting between browser-native and jQuery event objects. Please make sure there is some way to find out the result of the beforeunload handler, because that's the whole purpose of triggering the event manually. (I am putting an iframe inside a dialog. When closing the dialog, I want to check if the loaded page lets me do that.)

Changed February 24, 2014 03:15PM UTC by dmethvin comment:3

component: unfiledevent
milestone: None1.11.1/2.1.1
priority: undecidedlow
status: newopen

Changed March 04, 2014 03:21AM UTC by dmethvin comment:4

owner: → dmethvin
status: openassigned

Changed March 05, 2014 02:50AM UTC by Dave Methvin comment:5

resolution: → fixed
status: assignedclosed

Event: Allow triggerHandler(beforeunload)

Fixes #14791

Changeset: 06adf7c95d93507908181995a9ea15fe2729595a