Opened 15 years ago

Closed 14 years ago

#3567 closed defect (fixed)

addOnUnload events fire on windowon.unload at which time which Firefox is unstable

Reported by: sjmiles Owned by: James Burke
Priority: high Milestone: 0.9
Component: Core Version: 0.9
Keywords: Cc:
Blocked By: Blocking:


At window.onunload time Firefox appears to be at an odd state, some objects are not accessible from some scopes, and Firebug is confused.

window.onbeforeunload seems more reliable. IE still needs to use onunload because it has it's own issues which are documented inline in hostenv_browser.js.

It's potentially confusing to have addOnUnload really do addOnBeforeUnload on some browsers, but I'm not sure users care. If you just want to "do something at the end" it should be ok. If you really want one of the specific events, you can connect directly.

Change History (8)

comment:1 Changed 15 years ago by sjmiles

(In [9367]) Change addOnUnload events to fire at window.onbeforeunload (except on IE), refs #3567.

comment:2 Changed 15 years ago by sjmiles

Resolution: fixed
Status: newclosed

comment:3 Changed 15 years ago by James Burke

Milestone: 0.9beta0.9
Resolution: fixed
Status: closedreopened

This page seems to indicate that caching will be disabled if there is a window.onbeforeunload handler:

It may just mean the in-memory cache is not used (for things like fast back rendering), but some references on the web seem to indicate that it also affects the normal browser cache.

I'm going to reopen for 0.9, so that we can verify if it has an effect on caching. I'll assign the bug to me (at least the part about checking the affect on the cache).

comment:4 Changed 15 years ago by James Burke

Owner: changed from sjmiles to James Burke
Status: reopenednew

comment:5 Changed 14 years ago by James Burke

Milestone: 0.91.0

Talked with Alex about it. He thought it just affected the "fastback" back button cache. I'll push to 1.0 and follow up with sjmiles on the motivation for this change.

comment:6 Changed 14 years ago by James Burke

This page the bfcache is affected by any type of unload registration:

comment:7 Changed 14 years ago by James Burke

Milestone: 1.01.1

comment:8 Changed 14 years ago by James Burke

Milestone: 1.10.9
Resolution: fixed
Status: newclosed

It seems this is only affects the back/forward cache and not the normal cache, given the info above, so re-closing this ticket.

Note: See TracTickets for help on using tickets.