[webkit-gtk] Migrating to Webkit2 from WebKit1

Niranjan Rao nhrdls at gmail.com
Thu Dec 12 12:50:13 PST 2013


Thank you for the response. Very helpful.

I am trying to understand web process separation and how it impacts our 
code. Today we spawn multiple separate processes with web view embedded 
and drive it. No data is shared between these processes.

With new architecture will this still be the case? Can I have multiple 
processes running and still maintain data isolation between these 
processes? Some of the data we get from sites visited is session based 
and its important for us not to mix sessions when we are visiting same 
sites using two different processes. We do especially care about cookies 
and not mixing it. For current release we setup separate cookie jar file 
for each process. I know they still share some HTML5 data, but not many 
sites are using those features today.



On 12/12/2013 11:42 AM, Carlos Garcia Campos wrote:
> El jue, 12-12-2013 a las 11:25 -0800, Niranjan Rao escribió:
>> Greetings,
> Hi,
>> I am trying scope efforts required to migrate to Webkit2 from Webkit1. I
>> came across blog entry by Carlos Garcia Campos at
>> http://blogs.igalia.com/carlosgc/2013/09/10/webkit2gtk-web-process-extensions/,
>> which answered some of questions/problems I had with newer release, it
>> raised some new questions as I started digging into API.
>> Currently we use webkit 2.0.1 release in Webkit1 mode. We would like to
>> move latest and greatest to use some new useful features (big thank you
>> for these features).
>> My application is in Java using JNI calls to webkit. Its a scraping
>> application for all practical purposes where code "understands" contents
>> of the page and then decides which field needs to filled, selected or
>> clicked. In other words it drives browser window in similar way a human
>> will drive, but decisions coming from code which involves heavy DOM
>> access and manipulation.
>> 1. How long webkit1 support will be active? Will there be a cutoff point
>> that says Webkit1 will not be supported after this point
> WebKit1 is in maintenance mode, we only fix bugs and some minor API
> additions like settings and all in a very low priority. But we don't
> have plans to remove WebKit1 in the short term.
>> 2. Can  Webkit2 be used by python libraries using introspection? While
>> not necessary for our code, it makes life easier to do quick test in python.
> Yes, with some limitations. Web Extensions can't be used for now. We are
> not generating the introspection files for the web extensions API (I
> plan to fix that soon), but the main problem is that web extensions are
> a shared library loaded at run time by the web process, so I don't know
> how to make that work in python.
>> 3. New window - could not locate equivalent of "create-web-view" signal
>> so far. If a page needs to have new window, how do I handle this?
> http://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#WebKitWebView-create
>> 5. My code does lot of DOM manipulation. We have  a driver thread which
>> channels DOM requests to GUI thread using gtk_idle_add. With new
>> architecture with extensions and processes, do we need to change this
>> strategy?
> You need to move all that code to a web extension, and use a different
> way to communicate with the UI process. In Epiphany, we use D-Bus for
> such communication, see:
> https://git.gnome.org/browse/epiphany/tree/embed/web-extension
>> 6. WebKitWebPage::send-request - what exactly is treated as resource?
> Everything that is loaded by the frame loader, CSS, images, scripts,
> fonts, etc.
>> Any thing that will be fetched from remote server like images/css etc?
> Yes.
>> What about pdf or other files than browser won't display.
> This signal is emitted before the request is actually sent to the
> server, so that it happens before the policy checker decides whether to
> handle that in the web view or not.
>> 7. Any other notes/warnings your care to add
> Feel free to ask any other question :-)
>> Appreciate the great work and new functionality,
>> Niranjan
> Regards,

More information about the webkit-gtk mailing list