After experimenting with WebkitGTK in C, and looking through the documentation, I see that most of the signals/events relating to the loading of webpages are oriented around when a page begins loading or finishes loading.
However, I don't see anyway that the actual HTTP headers of a request are exposed. Therefore, I don't see anyway to detect, for example, if webkit_web_view_load_uri
loaded a page with a 404 error. The error reporting mechanisms seem only concerned with network errors, rather than HTTP errors. In fact, I don't see anything to do with HTTP exposed in the WebkitGTK API at all.
Am I just missing something here? I even grepped the entire webkit
include directory for http
and HTTP
and nothing relevant comes up. So is there some way to determine whether a downloaded page is an HTTP error (some other error code other than 200 OK
)?
WebKit is just the layout engine, and does not include HTTP support. In the WebKitGTK port HTTP is handled by libsoup. You get the
SoupSession
usingwebkit_get_default_session
and proceed from there.