0
Answer

SHDocVw.WebBrowser's BeforeNavigate2 event not fired sometime,any idea?

battle legal

battle legal

15y
7.8k
1

hi,all

I'm working on a BHO program,something like a Dom Inspector,and I want to inspect every frame on the page,then do some stuff. first I choose the DocumentComplete Event,but later around I find DocumentComplete do not fired for each frame.and MSDN note:

"In pages where multiple frames are loaded, this event fires for each frame where the DownloadBegin event has fired. "

so I choose BeforeNavigate2 Event,MSDN says:" Fires before navigation occurs in the given object (on either a window element or a frameset element)."

thenI found most of time BeforeNavigate2 work fine,but sometimes it still won't fire! I'm little confused,do we can trust "BeforeNavigate2"?Is it just a bug?

any reply will be appreciate