Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4195 closed defect (fixed)

addOnUnload not working for Firefox/2.0.0.6.

Reported by: guest Owned by: James Burke
Priority: high Milestone: 0.9
Component: Core Version: 0.9
Keywords: addOnUnload firefox Cc: lukelalo@…
Blocked By: Blocking:

Description

I've been testing the first release candidate of 0.9 and I've found that dojo.addOnUnload(object, method) is not working for Firefox/2.0.0.6. I've tested it in IE6 and it's working perfectly, and in my previous nightly build (from 08/03/2007) it was working for both browsers.

Can it be fixed in 0.9?
Thanks
Pablo García
lukelalo@…

Attachments (1)

test.html (333 bytes) - added by guest 12 years ago.
Test Case of addOnUnload

Download all attachments as: .zip

Change History (7)

comment:1 Changed 12 years ago by James Burke

Owner: changed from anonymous to James Burke
Status: newassigned

comment:2 Changed 12 years ago by James Burke

Cc: lukelalo@… added

dojo.addOnUnload() seems to be working for me with r10236 (fetched today, 8/17/2007, Pacific time). Can you give a test case on how it is failing?

I used Firefox 2.0.0.6 on OSX, and I had a simple HTML page with this script block in the head of the HTML document:

<script type="text/javascript">
dojo.require("dojo.parser");
dojo.require("dijit.form.Button");
        
dojo.addOnUnload(function(){
    alert("we are unloading");
});
</script>

I get the alert if I reload the page or if I go to another web page.

If you can get a test case and attach it to this bug, in the next day or so, that would be good, since we are going to make the final 0.9 build probably this weekend.

Changed 12 years ago by guest

Attachment: test.html added

Test Case of addOnUnload

comment:3 Changed 12 years ago by guest

Ok, here you are your sample into an HTML page

I've tested it with Mozilla Firefox 2.0.0.6 for WINDOWS (may be that the problem?) (Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6) and it's still not working using 0.9 rc1 nor using 8/17 nightly build... and it works perfectly with IE6

comment:4 Changed 12 years ago by guest

Oh, I forgot... I don't get any error with firebug, so I think the problem is that for some reason the onunload (or onbeforeunload) method is not being fired. I've been looking at the differences between the 0.9rc1 and the 08/03/2007 nightly build but I've not been able to find out what may the problem be.

comment:5 Changed 12 years ago by James Burke

Resolution: fixed
Status: assignedclosed

(In [10248]) #Fixes #4195. addOnUnload not being called. Resulted from r10151. Adding a simple test and cleaning up docs (thanks to liucougar for pointing that out).

comment:6 Changed 12 years ago by James Burke

Thanks for the test case, it helped find the issue -- I realized I was using the wrong dojo.js in my previous test. Your test showed the breakage on OSX FF too.

Note: See TracTickets for help on using tickets.