edrikL / gears

Automatically exported from code.google.com/p/gears
2 stars 3 forks source link

In Firefox, window.onunload is called after our internal unload handlers. #270

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
var timer = google.gears.factory.create('beta.timer', '1.0');
var interval = timer.setInterval("var i = 10", 200);
window.onunload = function() { timer.clearInterval(interval); }

In the debugger, GearsTimer::HandleEvent() is called before 
GearsTimer::ClearInterval().  IE seems to call the Javascript before 
native code.

Original issue reported on code.google.com by gears.te...@gmail.com on 2 Oct 2007 at 10:53

GoogleCodeExporter commented 9 years ago
This is a general problem across the codebase in all the browsers. We are using 
the
same unload event as the content is, and there is no order guarantee. Sometimes 
we'll
get called before the content and sometimes after.

We need to find some other place to hook in to do this kind of stuff that is 
well
after content's unload event.

Original comment by gears.te...@gmail.com on 21 Mar 2008 at 6:51