Reputation: 183
I'm currently developing a firefox extension and I need to know when the user closed the browser , so I can call a function. I've searched firefox addon sdk documentation and I haven't found anything. Is there a solution to my problem?
Upvotes: 1
Views: 102
Reputation: 808
require("sdk/system/unload").when(function(reason) {
if (reason === 'shutdown') {
handleShutdown();
}
if (reason === 'disable') {
handleShutdown();
}
});
Upvotes: 3
Reputation: 1011
tried this?
<script type="text/javascript">
$(document).ready(function(){
window.onbeforeunload = function() {
var msg =" If you're not interested please let us know what we can do to improve."
return msg;
} });
</script>
Upvotes: 0