none
WebBrowser.DocumentCompleted when web page runs a script RRS feed

  • Question

  • I'm using the WebBrowser control successfully.  When DocumentCompleted fires, the html text is as I expect it to be.  But if a web page contains scripts and if a script is running, the final display of the WebBrowser may not be complete.  Is there a way to determine if a script is executing within a WebBrowser control?  What I want to do is execute some code after the WebBrowser is completely idle, so I need to detect if a script is running within the WebBrowser.  Such a script will not have been started directly by my program - it will have started owing to my program calling WebBrowser.Navigate.

    FYI, I'm using VB 2010 Express, Windows XP, current with all software updates.

    Monday, October 21, 2013 9:41 PM

Answers

  • No. For an active page like twitter or a score board the page may never be idle. You have to have knowledge about the page's structure to determine if page loading is complete. 


    Visual C++ MVP

    • Marked as answer by amercer Wednesday, October 23, 2013 1:52 PM
    Monday, October 21, 2013 10:40 PM

All replies

  • No. For an active page like twitter or a score board the page may never be idle. You have to have knowledge about the page's structure to determine if page loading is complete. 


    Visual C++ MVP

    • Marked as answer by amercer Wednesday, October 23, 2013 1:52 PM
    Monday, October 21, 2013 10:40 PM
  • Thanks.  So, for all cases it is impossible.  But for some pages it would be useful.  It is a very common design to use a script to populate sections of the web page with data and then stop running.
    Wednesday, October 23, 2013 1:54 PM
  • yes you have to determine that by analyzing the script's DOM changes to find the difference between loading and complete. 


    Visual C++ MVP

    Wednesday, October 23, 2013 2:21 PM