[webkit-gtk] webkit2gtk resources
victor.lucero at ipartner.cl
Thu Aug 28 07:32:56 PDT 2014
I just re-read my e-mail and it was incomprensible, my bad.
let me paraphrase myself again.
1)Got the actual data for all the resources been downloaded its a bit tricky. in our case we use webkit_get_default_session() to access the soup main session and attach a "request-queued” event into it so for each element downloaded you could access the soup-message, and for each soup-message you can attach "got-chunk” so every piece of data is send to that event and you need to manually store it to get its length and contents- sadly this events was removed in libsoup 2.39.4 if I remember well. but thanks that its open source I patched that feature back (ugly but I was desperate) if you want i cane send you that patch , its works in the latest version of lib soup used by webkitgtk and webkit2gtk.
Sadly there is no element in the api to get or catch the frames that are created in a webpage, the guys here told me to file a bug asking for this feature in webkit2gtk but in the old API is present via the signal “frame-created” over a web_view or frame. I think i will file that bug because i need that functionality but im still working with the old API.
2) the method and patch described in point 1 also works for all the elements that pass throughout the browser so all the elementos downloaded by the flash and the fly itself can be obtained :)
3) how are you capturing these screenshots? We do screenshots accessing Cairo but our tool make sure that the page is full loaded, also found that some pages just crash the xlib if the page is too heavy and you don’t use a scrollview to contain it. please, tell me more details about this issue.
I hope this help
El 27-08-2014, a las 13:02, Jose <jmalv04 at gmail.com> escribió:
> In a previous discussion
> the webkit_web_view_save_to_dir was proposed.
> What ended up being implemented was webkit_web_view_save and
> _save_to_file, which dump the webview using
> the MHTML format.
> I thought it would be useful for my understanding to dump each
> resource to a file, so I basically
> follow the approach described in the testing files
> - connect to resource-load-started
> - Connect to loaded signal and add each resource to a GLIst
> - wait some time after the page has loaded
> - take a snapshot
> - save the resource and subresources to a directory
> This works well for most web pages but I have 3 cases I don't know how
> to handle (using 2.5.3):
> 1) The page has frames
> E.g. when I Ioad a URL with this content
> <frameset cols="10%,10%,80%">
> <frame src="data:text/html,ok" />
> <frame src="/doesnotexist.html" />
> <frame src="/test/index2.html" />
> I get the following (status code, type, url, get_content_len, actual dataSize)
> 200 html /test/frames_broken.html 202 202
> 200 html /test/index2.html 41 0
> 404 html /doesnotexist.html 168 0
> 0 html data:text/html,ok 2 0
> The main_resource and the data URI are ok but I am unable to get the
> content for the other two frames (and I think at least I should get
> the 41 bytes content from /test/index2.html, as it has status 200)
> 2) The page loads a Flash plugin
> I would need to save the file that is being passed to the plugin (and
> maybe a reference to which plugin, which may be obvious from the
> extension). The plugin content file does not show as a Resource.
> 3) Debugging a large page
> I've taken snapshots of several large pages and they render properly.
> When I try a full page rendering of http://www.yahoo.es, there are some images
> missing (happens for short and long waits after load
> but does not happen when the rendering is limited in height).
> Anecdotally, I verified that these final images load slowly in
> Epiphany 3.10 (but not so much in the 2.5.3 MiniBrowser) and
> they load much faster in Firefox.
> And when I look at the resources, the images not in the snapshot are
> missing but I don't get any non-200 status code or failed callback.
> Any ideas on how to approach these three issues ?
> webkit-gtk mailing list
> webkit-gtk at lists.webkit.org
-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4157 bytes
Desc: not available
More information about the webkit-gtk