[webkit-dev] Deep copy of the page with it's JS context

Benjamin Poulain benjamin at webkit.org
Wed Dec 12 12:21:54 PST 2012


On Wed, Dec 12, 2012 at 11:03 AM, Николай Матюнин <matyunin.n at gmail.com>wrote:

> I need your help (or just some advice).
> Currently I use WebKit (actually phantom.JS, which is based on the WebKit)
> as an instrument to research and develop the effective methods of ajax
> web-applications crawling (just for academic purposes).
>
> So, during the crawling, the application changes it's state after some
> event was fired by the crawler. Then crawler should* go back to the
> previous state*, to fire another event (and to get one more possible
> state), and so on.
>
> Thus, I'd like to have the possibility to make a deep copy of the page
> current state, including not only DOM tree copy, but also entire JavaScript
> context of the page.
> I have successfully (to a certain degree) achieved this goal with HtmlUnit
> and Rhino JS engine, but Rhino is not supported in any real modern browser,
> so I want to use WebKit (and JavaScriptCore or V8 JS engine).
>
> Can I achieve this goal with WebKit? Is it possible technically? (As I
> see, this "hack" was not supposed by design, most classes in source code
> are not copyable and so on). Which classes I should consider first?
> Maybe, it's better (and more simply) to use V8 engine (than JSC) to
> achieve this goal?
>

This is the wrong mailing list for this kind of questions. Try webkit-help:
http://lists.webkit.org/mailman/listinfo
WebKit-dev is about the development of WebKit (and following the goals of
the WebKit project).

----
My answer:
If you are using Linux and don't care too much about efficiency, it may be
easier to patch the kernel to snapshot the process state and memory, and
restore it when needed.
In any case, what you describe is fragile for any page with external side
effects (system services, Web storage, cookies, etc.).

Benjamin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20121212/422c0a36/attachment.html>


More information about the webkit-dev mailing list