the best way to do it is to look at the webbrowsers current URL when that event fires. Then you will know what URL the user is actually viewing, so your code can take appropriate action.