Bug Tracker

Ticket #14791 (closed bug: fixed)

Opened 10 months ago

Last modified 9 months ago

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:
Blocking: Blocked by:

Description

The following code:

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

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

Change History

comment:2 Changed 10 months ago by fejesjoco

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.)

comment:3 Changed 9 months ago by dmethvin

  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to event
  • Milestone changed from None to 1.11.1/2.1.1

comment:4 Changed 9 months ago by dmethvin

  • Owner set to dmethvin
  • Status changed from open to assigned

comment:5 Changed 9 months ago by Dave Methvin

  • Status changed from assigned to closed
  • Resolution set to fixed

Event: Allow triggerHandler(beforeunload)

Fixes #14791

Changeset: 06adf7c95d93507908181995a9ea15fe2729595a

Note: See TracTickets for help on using tickets.