Webkit GTK: determining when a document will load

There are still questions on StackOverflow that are close to what I want to know, for example Webkit GTK :: How to determine when a download is complete? but I think I'm asking for something else:

In general, in the event-driven C Webkit-GTK API, there are many events that may relate to the idea when a document is finished loading. The problem is that the documentation is quite rare, and the idea of ​​a “finished download” is not necessarily clear, as it can relate to a lot of things. “Ready to download” means the document is finished for downloading? What did he finish creating the DOM tree? That he completed the download, including all other resources (e.g. CSS, JS, and image files?)

The corresponding signals are: signal::notify::load-status , document-load-finished and resource-load-finished .

The load-status signal is triggered every time the load status changes, so you need to manually call webkit_web_view_get_load_status and check the status each time. However, when the status is finally WEBKIT_LOAD_FINISHED , I'm not sure what this means - does this mean that WebKit is completing the loading of the resource or completing the creation of the DOM tree, or what?

Question:

What is the difference between the various "ready-made" signals and is there any signal equivalent to the standard DOM events Javascript window.onload ?

+4
source share
1 answer

I believe document-load-finished signal is what you are looking for as it seems (in my opinion) to more accurately match what you are trying to verify.

One of the ideas that should be checked is the right way to do this, in order to check the different ways of checking if the document is manually uploaded. That is, try the one with which I am connected above, and output a string to the terminal when the value is true. If the value is true before the page fully displays all its contents, most likely this is not the one you need. Then move on to the next until you get the right one.

Other than that, I'm not quite sure what else you can do, because, as you mentioned, the definition is not very clear. Sounds like this, I would like the Gtk documentation to be a bit more detailed.

0
source

All Articles