[webkit-gtk] webkit_resource_get_data returns NULL even frame load status shows finished

Yin Liu Yin_Liu at symantec.com
Fri Jan 6 09:38:28 PST 2012


Hi,
I am using webkit-gtk to fetch the content of the downloaded WebKitWebResource.  However, even the frame load status shows finished, some of the resources I fetched has no content.
Here is the code:
frame = webkit_web_view_get_main_frame(webkitwebview);
status = webkit_web_frame_get_load_status(frame); // this value shows 2 ( finished )
datasource = webkit_frma_get_data_source(frame);  // this is not empty
list = webkit_web_data_source_get_subresources(datasource); // the list has more than 10 subresources
for(int I = 0; i < g_list_length(list); i++) {
            subresource = g_list_nth_data(list, i);   // not empty for all subresources
          data = webkit_resource_get_data(subresource);  <<<<<<<<<<  Problem! Some subresources return NULL pointer!!
}

The empty subresources are actually displayed in WebInspector. So I assume they should have been successfully downloaded when the frame loading finished.

Take www.google.com<http://www.google.com> for example, there is an extern javascript included in the main frame. It is displayed in Inspector, but call of  webkit_resource_get_data returns NULL pointer.

Is this a bug, or did I miss something here?

Thanks,
   Yin


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20120106/bde380c1/attachment.html>


More information about the webkit-gtk mailing list