When a user wants to edit a task the file gets locked. When they save or hit the close button(from the dialog) the file gets unlocked.
However if the user clicks any of these : Back button, forward button, close tab/browser
the file is locked. I have a cleanup scheduler that unlocks all files after X minutes.
However I would love to be able to do one last request to unlock the file so people don't have to wait X minutes till the task unlocks itself becasue someone decided shut their browser down.
I found this
$(window).unload(function ()
{
alert('unloaded');
});
However I have no clue what browser it supports or if it does everything I require it to do.