[webkit-help] headless port

Ryosuke Niwa rniwa at webkit.org
Fri Aug 30 15:29:09 PDT 2013


Detecting when a page load has finished is tricky because some pages use
timers to load more contents. On pages with infinite scrolling or dynamic
loading, user actions are required to load the entire content.

Having said that, there's something called estimatedProgress on mac port's
WebView.  You might want to look into what it does.

But honestly, your time might be better spent improving PhantomJS or
QPrinter instead.

- R. Niwa

On Fri, Aug 30, 2013 at 11:35 AM, Derek B. Noonburg
<derekn at glyphandcog.com>wrote:

> I'm working on a custom WebKit port that converts HTML to a list of
> drawing operations (essentially each GraphicsContext call generates an
> entry on the list).  The ultimate goal is an HTML-to-PDF converter.  The
> second part of the project will convert the list of drawing operations
> to PDF.
>
> This is all being done "headless", without any sort of GUI.
>
> One problem I'm running into is the event loop.  Right now, my code
> loads a URL (FrameLoader::load()), and then goes into a loop to handle
> timer callbacks (which are set with
> WebCore::setSharedTimerFireInterval()).  When loading is finished
> (FrameLoaderClient::dispatchDidFinishLoad()), the event loop exits.
>
> That works fine for basic stuff, but doesn't handle asynchronous
> JavaScript (e.g., if JavaScript code is waiting on a timer, or for
> WebSocket data, etc.) at all.
>
> Is there a good way to handle this?
>
> I have the possibility of adding some JavaScript code to emit some sort
> of "finished" signal (as long as the code can still run in a regular
> browser).  What would be the easiest way to pick up that signal from the
> WebKit side?  I haven't really looked into the JSC code very much yet.
>
> (If this post would be more appropriate on webkit-dev, please let me
> know.)
>
> - Derek
>
> _______________________________________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-help
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20130830/68d6a8c9/attachment.html>


More information about the webkit-help mailing list