I have a WebBrowser
control is Windows Forms project. It navigates through all the urls available in “MyTableTest.html”. There are four urls in this page and the
"Location 1" is printed but not "Location 2". What is your suggestion to overcome this? Were you able to reproduce this issue?
I haven't tried to repro, but like I said in the comment, it's obvious that either DocumentCompleted
or window.onload
is not getting fired for that particular URL. That's possible if the page cannot be fully loaded, or e.g. if the URL is invalid or the server becomes unreachable. That's what the time-out logic is for.
Put one more trace at the beginning of documentCompletedHandler
, and one more inside onloadEventHandler
:
onloadEventHandler = (s, e) => { Log("inside onloadEventHandler");
onloadTcs.TrySetResult(true); }
See what gets fired and what doesn't.
Besides, your should also implement WebBrowser Feature Control to enable the modern IE features. This also often affects how web page are loaded. Copy SetFeatureBrowserEmulation
from here.