How to identify a browser refresh event
I’m currently writing a cool BHO ( Browser Helper Object ) and one of the things that I've noticed is that there seems to be missing a way to receive a Refresh event notification from the browser.
Why do I need a refresh event ? well its because the browser doesn’t raises a DocumentComplete event on a page refresh.
So what are the steps to receive a notification of a browser refresh event ?
1. Register to BeforeNavigate2, DocumentComplete, DownloadComplete events.
2. Declare a global boolean by the name of refresh and give is the value of true.
3. On the BeforeNavigate2 event set the value of the boolean to false.
4. On the DocumentComplete event set the value of the boolean to true.
5. On the DownloadComplete event check the value of the boolean and if its true do whatever you want …