curiouswebster
asked on
No way to find if the browser is closing??
I come from the desktop application space and find it shocking that I can not easily determine that the browser is closing. I have tried using JavaScript and catching the onunload and beforeunload events but find they fire regardless of what the user has done on the page, including clicking the Close button in the upper right corner of the window.
That seems so foreign to me.
Isn't there a way? Isn't there an addition test I could do in JavaScript to test if the browser is still open?
100% of my users will be on Windows. Can't I read the ProcessID when the page loads, then I detect an onunload event start a timer that will fire in 30 seconds. When that timer fires it will check if the ProcessID still exists and if not, the page has closed.
I don't know if that could ever work but I am trying to get your mental juices flowing about what I could do if I really really wanted to be notified when the browsers has closed. And to demonstrate I am willing to be a little unconventional about how I accomplish this.
Thanks,
newbieweb
That seems so foreign to me.
Isn't there a way? Isn't there an addition test I could do in JavaScript to test if the browser is still open?
100% of my users will be on Windows. Can't I read the ProcessID when the page loads, then I detect an onunload event start a timer that will fire in 30 seconds. When that timer fires it will check if the ProcessID still exists and if not, the page has closed.
I don't know if that could ever work but I am trying to get your mental juices flowing about what I could do if I really really wanted to be notified when the browsers has closed. And to demonstrate I am willing to be a little unconventional about how I accomplish this.
Thanks,
newbieweb
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, I'll dig into this.
ASKER
Or using Alt+F4?
Is there no back door method I could devise? Is there any information anywhere that's changed which I could inspect for changes?