0

I am probably looking at one of the most frequently asked question when automating a website -

How do I wait for the HTML to be ready?

This question is complicated even more by Frames.

I see the Frame Navigation Complete event which exposes only CoreWebView2NavigationCompletedEventArgs which really does not give you much help. Once this event is fired is the developer left with only JavaScript injection into the Top Document to find out the status of a frame and especially the DOM? From the CoreWebView2 events how can you identify which Frame to then check with Javascript? Does the API currently expose for example the Name and/or ID of this frame?

I believe that a Frame has the same properties and events as a browser so is it possible to get a frame as a CoreWebView2 object.

darbid
  • 2,545
  • 23
  • 55

1 Answers1

1

This is not currently supported directly. You might check our github project frames related feature requests and add a +1 if you find a matching one or open a new one. We have plans to add frame objects in the future but it will be good to have your specific scenarios recorded to ensure we can consider that as well.

As a workaround you might check if Chrome DevTools Protocol has APIs that would be helpful for you. From WebView2 you can use CoreWebView2.CallDevToolsProtocolMethodAsync to call CDP methods and CoreWebView2.GetDevToolsProtocolEventReceiver to receive CDP events.

David Risney
  • 3,886
  • 15
  • 16