Assumed that i have web pages with an arbitrary amount of elements which have an event handler attached, let's say onclick
. In the handler an unload event is triggered, for example by assigning window.location
.
The task: I need to detect if an event handler will unload the page. How can i add another event handler which intercepts the unload event and stores it in a variable instead of triggering it?
Update
Here is an explenation, due to confusion. I have written a Java application that uses Selenium 2 to pull all information about user events. This is easily done, except for unloads. I have to wait for the pull before i can finally unload the page.