<p>I would like to intercept any URL which the user enters in their browser and perform some tasks before allowing the navigation to continue (any way could be good - i.e. via plug in, via proxy or any other creative suggestion).
To clarify - I am not referring to a specific application that needs to catch this, but rather - any navigation that the user does on his browser needs to be caught (i.e. the user is not opening my application, it should be running in the background or something like that...)
Thanks in advance...</p>

If you're using Javascript, there's an event which fires when the user exists a page called
```
onunload
```
.
```
```
window.onunload = function() {
    alert("You're leaving this page.");
};
```
```