mobileFX WebKitX CEF3 ActiveX 4.x
WebKitXCEF3Lib ActiveX Control / WebKitXCEF3 Object / OnLoadingStateChange Event

True only when loading, False if loaded completed or resulted to an error.

Indicates that NavigateBack can be called.

Indicates that NavigateForward can be called.
In This Topic
    OnLoadingStateChange Event
    In This Topic

    Fired when the loading state has changed.

    Visual Basic
    Public Event OnLoadingStateChange( _
       ByVal IsLoading As Boolean, _
       ByVal CanGoBack As Boolean, _
       ByVal CanGoForward As Boolean _

    True only when loading, False if loaded completed or resulted to an error.


    Indicates that NavigateBack can be called.

    Indicates that NavigateForward can be called.

    This event will be fired twice for the main frame:

    • When loading is initiated either programmatically or by user action.
    • When loading is terminated due to completion, cancellation of failure.

    It will be called before any calls to OnLoadStart and after all calls to OnLoadError and/or OnLoadEnd.

    Loading Sequence

    Loading Sequence

    WebKitX provides several Events during its initialization, creation of the browser and loading of a URL. First you need to set the licensing information by handling the early Form Loading or Creation event. Then you can control CEF Browser creation by handling the OnCreate event. Once the browser is ready it will emit the the OnBrowserReady event where you can enable JavaScript or HTML5 editing parameters. In OnBrowserReady you should also load the HTML5 markup or navigate to the URL you want to load.

    During loading WebKitX will fire several loading events such as OnLoadStart and OnLoadEnd. If you are loading HTML with frames (IFRAMEs) then some events will fire multiple times, such as OnPageLoadStart and OnPageLoadEnd. When the main frame is loaded WebKitX will fire OnLoadEnd and when all frames have loaded WebKitX will fire the OnPageComplete event.     

    When you receive the OnLoadEnd and OnPageLoadEnd events, it means that network-wise the contents have downloaded but HTML-wise the contents might not be fully parsed yet. In HTML terms this means that document.readyState value might not not set to complete. Pages in window or sub frames might be in interactive state and resources might be loading in the background. The only event that guarantees that the main window frame and all sub-frames have document.readyState = complete is OnPageComplete.

    Internally, WebKitX uses an asynchronous task that checks the document.readyState for all frames; if this check result is "complete" with a count equal to browser frames, then the event is fired. If some frames have loaded while other frames have failed, the event will not fire. The check takes place on a fresh HTML DOM snapshot obtained every time at the moment of the check, and examines the current number of frames. The frames must remain unchanged for 3 seconds before the event is fired; this way, any dynamic loading or unloading of frames is taken into account.

    Please note that some frameworks such as Angular and React dynamically load portions of the page. WebKitX events will keep firing while dynamic content is downloaded. You need to examine the behavior of the control in relation with the web site you want to display and adjust your event handling accordingly.

    See Also