My first patch to WebKitGTK+ committed!

Well, not really my first patch. But the first thing I tried to mess with when I first started looking at WebKitGTK+ was the WebKitNetworkRequest object, because I was fancing the idea of writing stuff such as HTTP transactions monitoring, and things like that. So I wrote a big patch which exposed the internal WebCore object (ResourceRequest) fully through our own object. That was back in early 2008. We have come a long way since, and through all these months I got a broader perception of what kind of APIs we need, and how WebCore works. We also decided on going soup-only, which had a huge impact on what the final patch actually looks like.

The patch which finally got committed this week is, how can I put it, VERY different from what I had originally written. You can take a look at the long discussions about it in the bug report I used to track progress. I think I should point out that Marco Barisione and Christian Dywan were crucial in helping me get going with my contribution to WebKit at that time.

What this change gives us is basically the fact that a WebKitNetworkRequest now carries more than just the URI for the request (it actually carries with it a reference to the SoupMessage that will be used later in the request processing, which we are planning to expose in the near future), meaning that when WebKit API gives you a request, and you use it to cause a new load (for, say, opening in a new tab), you still get all the headers that were supposed to go with the request, so you don’t lose things such as, for instance, Referer. So, now, after more than 5 years, the bug that complained that Epiphany did not set Referer (and Galeon before that) for new tabs is finally closed.

By the way, this problem has been fixed for Mozilla’s browser back in 2002, but the embedding API is still buggy up to now. There is still hope, since there’s an attached patch that fixes the issue to be reviewed, and landed. If anyone is reading, it might be a good oportunity to get this fixed in there as well, so that users of applications that use Gecko’s embedding API can also benefit!

6 thoughts on “My first patch to WebKitGTK+ committed!”

  1. Hello kov.
    Nowdays, I enjoy webkit-gtk with Web Inspector. Your Patch is really Good!! I am impressed.

    but, I have some trouble with your GtkLaunch patch… ( )

    This patch works good at R38760 , and another versions…
    But, Webkit-GTK 1.1.1. to Webkit 1.1.8 doesn’t work with Your GtkLaunch patch.

    Belows are error logs…. ( My Linux is Ubuntu 9.0.4 )

    #> GtkLauncher
    GLib-ERROR **: The thread system is not yet initialized.
    I also debugged that code. so. I found some error. when inserting your patch to GtkLaunch, WEBKIT_WEB_VIEW(webkit_web_view_new() ); in create_browser function returns NULL.
    of course, I downloaded and studuied your midori code, but I couldn’t fix this error.
    so, could you care of this gtklaunch patch?

  2. I have solve this problem by insert below line….

    gtk_init (&argc, &argv);

    + if (!g_thread_supported())
    + g_thread_init(NULL);

    um. I have some other questions for webinspector.
    If I want to view another PC’s webkit , is it possible? (when Inspector executes PC and inspector views PC are diffrent. )

    any way. your WebInspector Gtk Port is really Good!.

  3. @ElongBug: yeah, I would recommend using Epiphany or Midori for using the Web Inspector, instead of GtkLauncher with my patch, really, =).

    I don’t know if I understand your second question, but I think what you want is to be able to inspect a page that is open in a different computer? It is not possible to inspect a page that is open in a different process at all, the inspector is directly connected to the WebView, under the hood.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>