10

I have some difficulty to understand what WebKit, WebKitGTK, GTK are with the different versions. Here is what I have so far :

  • WebKit is a library which contains both WebKit1 and WebKit2. Which one is called with this include #include <webkit/webkit.h>?

  • WebKitGTK 1.10.2 is the last version to depend on GTK2. Is it still maintained/developped?

  • Does it always need to be supported by GTK, Qt or some other toolkit? Or would it be possible to use it alone?

Gradient
  • 2,253
  • 6
  • 25
  • 36

3 Answers3

7

You have to distinguish between version number and api level.

  • The version number is something like 1.10.2 or 2.2.1 - and that's it, just the version number - it has nothing to do with the GTK version or api level.
  • There are two different apis: webkit (webkit/webkit.h) and webkit2 (webkit2/webkit2.h). The main difference is that webkit2 uses a multi process architecture for the rendering, javascript and plugins instead of the single process architecture of webkit.

WebKitGTK+ can be compiled against either GTK+2 or GTK+3. This will result in library filenames like libwebkitgtk-1.0.so or libwebkitgtk-3.0.so, respectively. (This has nothing to do with the version of WebKit itself.) However, the webkit2 api depends on GTK+3 and the library filename is something like libwebkit2gtk-3.0.so.

WebKitGTK+ and the other ports implement stuff like:

  • drawing ui elements (checkbox, selectbox,...)
  • dialogs (file choose, download, http auth)
  • network communications (handling dns and http)
  • ...

You would need to implement this all by yourself if you want to avoid any available webkit port.

PS: WebKitGTK+ 2.x.x does still support GTK+2

Ivaldi
  • 660
  • 6
  • 22
  • I'm still a bit confused... "WebKitGTK+ 2.x.x does still support GTK+2". Does this mean I can compile WebKitGTK+ 2.x.x with GTK+3 and expect it to still be compatible with GTK+2 applications? – Apteryx Apr 12 '18 at 02:24
1

WebKitGTK is a "port", and yes you practically do need to pick one of the several ports, using webkit alone basically means writing your own port which is a massive job. On linux I would suggest going with WebKitGTK or QtWebKit.

WebKit and WebKit2 are two totally different web engine APIs that happen to live in the same source tree (that as a whole is also called WebKit) and use the same core components. The big difference is that WebKit2 splits web content handling to a different process -- I believe it's also the only one with serious development going on. You don't really need to choose between these two as the port has typically already made a choice: you just use the API the port provides. GTK+ port used to be on Webkit but should now use WebKit2 (but the Webkit API may still be there for now).

If 1.10.2 really was the last version to support GTK2 (note that I don't know if this is true), then I'm fairly sure it's not being developed further.

EDIT: On debian the library options are:

  • libwebkitgtk-1.0 2.2.0: Webkit1, GTK+ 2
  • libwebkitgtk-3.0 2.2.0: Webkit1, GTK+ 3
  • libwebkit2gtk-3.0 2.2.0: Webkit2, GTK+ 3

So it looks like GTK+ 2 is still at least somehow supported, but (at least on debian) you only get WebKit2 API with GTK+ 3. That option should be the most future-proof.

Jussi Kukkonen
  • 13,857
  • 1
  • 37
  • 54
1

The ONLY Linux port of WebKit is WebKit2-GTK3. All the others are dead and do not receive security updates, which makes them trivial targets for hackers. If you have an application that depends on other versions of WebKit on Linux, uninstall it. End of story.

Yes, the WebKit2 API is less powerful. That is irrelevant. If you are stuck on WebKit1, ditch it and either:

  • spawn a browser in its own process
  • switch to the Chromium Embedded Framework.
Demi
  • 3,535
  • 5
  • 29
  • 45