c# - DocumentCompleted firing multiple times - accepted StackOverflow answer not working -
i test if webbrowser completed with:
webbrowser2.documentcompleted += (s, e) => { // stuff }
the webpage accessing tons of js files , iframes , stuff, use below function make sure it's actual page that's completed loading.
webbrowser2.documentcompleted += (s, e) => { if (e.url.absolutepath != (s webbrowser).url.absolutepath) { return; } // stuff }
however, still doesn't appear working. doing wrong or syntactically correct , there's other error in code?
documentcomplete
may fired multiple times many reasons (frames, ajax, etc). @ same time, particular document, window.onload
event fired once. so, perhaps, can processing upon window.onload
. answered related question on how can done.
Comments
Post a Comment