Bug Tracker

Modify

Ticket #6027 (closed bug: worksforme)

Opened 4 years ago

Last modified 4 years ago

onbeforeunload breaks events in Chrome 4

Reported by: menno Owned by:
Priority: major Milestone: 1.4.2
Component: unfiled Version: 1.4.1
Keywords: Cc:
Blocking: Blocked by:

Description

Steps to reproduce:

  • create a page with an onbeforeunload event
  • try to reload/close the page and see the browser dialog appear
  • choose to stay on the page

Expected result:

All events are still attached to their DOM elements.

Actual result:

No events are being fired anymore.

The problem appears to be "return (new Date).getTime()" in the function now() which doesn't return anything valid anymore after the canceled reload. If I change the function to return "(new Date).valueOf()" it seems to fix the problem.

See the attached HTML for a testcase.

Attachments

bug.html Download (1.5 KB) - added by menno 4 years ago.
testcase

Change History

Changed 4 years ago by menno

testcase

comment:1 Changed 4 years ago by menno

Since the bug is originally caused by Chrome's faulty new Date().getTime() I've created a bug in Chromium's tracking system as well:

 http://code.google.com/p/chromium/issues/detail?id=33441

comment:2 Changed 4 years ago by svcorp77

Chrome 5.0.375.70 beta: fixed

comment:3 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to worksforme

Sounds like this was not a jQuery bug, and now that the Chrome bug is fixed I'll close this ticket.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.