load_changed


Description:

public virtual signal void load_changed (LoadEvent load_event)

Emitted when a load operation in web_view changes.

The signal is always emitted with webkit_load_started when a new load request is made and webkit_load_finished when the load finishes successfully or due to an error. When the ongoing load operation fails load_failed signal is emitted before load_changed is emitted with webkit_load_finished. If a redirection is received from the server, this signal is emitted with webkit_load_redirected after the initial emission with webkit_load_started and before webkit_load_committed. When the page content starts arriving the signal is emitted with webkit_load_committed event.

You can handle this signal and use a switch to track any ongoing load operation.

```c static void web_view_load_changed (WebKitWebView *web_view, WebKitLoadEvent load_event, gpointer user_data) { switch (load_event) { case WEBKIT_LOAD_STARTED: // New load, we have now a provisional URI provisional_uri = webkit_web_view_get_uri (web_view); // Here we could start a spinner or update the // location bar with the provisional URI break; case WEBKIT_LOAD_REDIRECTED: redirected_uri = webkit_web_view_get_uri (web_view); break; case WEBKIT_LOAD_COMMITTED: // The load is being performed. Current URI is // the final one and it won't change unless a new // load is requested or a navigation within the // same page is performed uri = webkit_web_view_get_uri ( web_view); break; case WEBKIT_LOAD_FINISHED: // Load finished, we can now stop the spinner break; } } ```

Parameters:

load_event

the LoadEvent