Ashwin
Ashwin

Reputation: 857

How to run a javascript when browser process is killed?

I hav onUnload="cleanup()" defined in my html body tag. The cleanup() method in javascript is

function cleanup() {--clean up session--}.

But when the browser is terminated by killing the process using task manager, I want to do the same action as cleanup. How can this be done?

Upvotes: 0

Views: 425

Answers (1)

janmoesen
janmoesen

Reputation: 8020

You cannot. If the process is forcefully killed, nobody cares about your scripts.

Upvotes: 2

Related Questions