954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Is it possible detect browser process termination?

I am a newbee to JavaScript was was just fiddling around with events for a browser...

Is it possible to detect the browser process termination done through the Task Manager in windows.

Process:
1. Goto Task Manager
2. Right click on the browser process e.g. iexplorer.exe
3. Select "end process" to terminate the process

JavaScript can detect the window close by using body onunload event. On the similar bases, is it possible to detect the process termination event using JavaScript??

I tried a simple example using body onunload, but it failed to run the onunload event during the browser process termination. And i am of the opinion that this is not possible as all using JavaScript since terminating a process is a system / OS level task and is not related to browser events.

nilesh.shinde
Newbie Poster
2 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

Nilesh,

I just tried and got the same result - onunload doesn't fire if process is killed.

I guess you're right - terminating the process acts at too high a level. The javascript engine must die before it has a chance to respond.

That said, I tested with IE6 under win 2000. It's just possible that there may be differneces in bahaviour depending on browser and OS. However, it seems certain that you can't rely on the event firing for all users in an internet-served application.

Airshow

Airshow
WiFi Lounge Lizard
Moderator
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
 

Thanks for your prompt reply..
i can now firmly conclude that this is not possible!!

Thanks for confirming on my understanding too...

nilesh.shinde
Newbie Poster
2 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You