Clarification on exactly what WebKit is?

I have been doing some experimenting (read farting about) with WebKit recently and I am now a bit confused by what WebKit actually is.

The Wikipedia article about WebKit states that it includes WebCore (HTML/CSS rendering engine) and JavaScriptCore (JavaScript engine) and that it is used in Safari amongst other apps. That sounds logical so I went to the WebKit Project page and downloaded a nightly of it (I did have a reason for doing this but it can wait for a future post :).

The confusion came when I launched WebKit in how similar it is to Safari! I expected a reference implementation of the basic browser but it is a full featured web browser that apart from the different colour surround to the compass in the icon is indistinguishable from Safari. It uses my Safari bookmarks, the menu items are identical, the annoying beach ball is there when loading large web pages, even the application name in the menu bar shows as “Safari”.

So, does this mean that other software that wants to use WebKit has to either include all of the additional Safari functionality or strip it out manually? This seems to me like a rather backwards way to do things, shouldn’t WebKit be an absolute bare bones implementation which applications can easily integrate and then Safari be a project based upon that (they could open source Safari itself if they want to give a more comprehensive example of WebKit being used).

Just seems a little strange to me, am I missing something?

Oh and I am going for “WebKit” rather than “Web Kit”, if it is good enough for their home page it is good enough for me.

Technorati Tags: , , , , , ,

Advertisements

10 responses to “Clarification on exactly what WebKit is?

  1. The page appears to be a little misleading. I think that it includes a nightly build of Safari which has the nightly build of the WebKit Framework embedded in it. I know for a fact that if you use WebKit your application doesn’t have to look like Safari. You can check out some of the different applications that make use of WebKit here. There is also a tutorial somewhere that shows you how to build your own WebKit powered browser in about six lines of code but I don’t know exactly where it is.

  2. As Twist alludes, there’s a difference between ‘WebKit.app’ (the demo application which is basically a nightly of Safari) and ‘WebKit.framework’ (which is the framework you can use and embed in other applications).

    Obviously the application host needs to be kept up to date in order to expose and test the new features of the rendering engine, so they helpfully provide the nightly build of that for you :)

  3. If you’re familiar with frameworks (they are a lot like libraries), Web Kit is a framework which you can use in your app for web-related tasks. Safari uses Web Kit, as do many other apps.

    The nightly build of Web Kit is bundled *within* Safari in order to test out the daily state of Web Kit. Most likely you wouldn’t want to replace your current system Web Kit install, so a bundled Web Kit + Safari is very useful for Web Kit developers, and for anyone interested in following the progress of Web Kit (perhaps you have a pet bug you’d like to see addressed), since it doesn’t affect the system itself.

    If you’d like to try out a newer version of Web Kit in an app you are writing, you’ll need to download the source code, although there are very few reasons to do this and many reasons not to.

  4. Your blog ate my comment :(

    I wanted to expand on the above—like Windows, Mac OS X has the concept of both system and application-specific shared libraries and frameworks. The difference in Mac OS X’s case is that the application-specific libraries are stored inside the application bundle itself, which makes everything nice and neat.

    The problem with distributing a binary release of the WebKit framework on its own is that people would undoubtedly try and install it over the top of the system framework, and things would likely break horribly in subtle but nasty ways. Not only that, but it’d probably get overwritten when Software Update did its thing.

    OmniWeb 5.5 Preview includes a private build of WebKit for the same reason—you can test new features without impacting on the rest of the platform.

    If you have a peek inside the WebKit.app bundle (right-click and ‘Show Package Contents’), you’ll find a Contents/Resources/ folder which contains the various frameworks which make up the WebKit nightly build proper.

  5. @Mo:

    Yes, Apple got that one right, the bundled web browser should not be deeply embedded in the os and instead should be able to co-exist within other applications and side by side with versions of itself.

    Microsoft have said many times that one of the things that held back development of IE was the immense amount of compatibility testing that was needed for each release.

  6. I figured that there might be two definitions to what WebKit is, as long as WebKit is both a component of the WebKit demo app then that makes things ok, if a little confused in its naming.

  7. I don’t think the demo app’s name is widely known beyond a certain sector of geeks willing to try out the nightlies—certainly, I didn’t know it existed until a couple of weeks back (I actually have a sneaking feeling it didn’t exist until recently, in actual fact).

    A better name would have been ‘WebKit Browser.app’.

  8. It turns out I’m actually slightly wrong.

    The WebKit application actually launches whatever version of Safari you have installed, setting up the environment in order to use the bundled version of the WebKit framework. It’s basically just a wrapper executable.

    Running ‘strings’ on WebKit.app/Contents/MacOS/WebKit reveals all (as well as looking at the output of ‘ps axeww | grep WebKit’ when it’s running).

  9. Thats interesting Mo, thanks.