For early adopters that want to test webkit2 without upgrading OS X 10.7 Lion developer preview, here’s a way to build it from source and run it from the webkit nightly app. Before we continue, a little background on webkit2, from macrumors:
“Starting in Mac OS X Lion, we’ve learned that Apple has started utilizing WebKit2 in their Safari web browser. The advanced version of Apple’s Webkit engine was first announced in April of 2010. WebKit2 is described as a new API layer for WebKit that offers both speed and security improvements:
WebKit2 is a new API layer for WebKit designed from the ground up to support a split process model, where the web content (JavaScript, HTML, layout, etc) lives in a separate process from the application UI. This model is very similar to what Google Chrome offers, with the major difference being that we have built the process split model directly into the framework, allowing other clients of WebKit to use it.
For the end user, the result should be a faster and more stable browsing experience. If a webpage crashes or hangs, only that single tab is affected rather than the whole browser. Subjective reports from early end users have indicated that the new Safari seems to run smoother.”
Before we start, a little disclaimer. This build will not show the new 10.7 UI changes that feature multi-touch and disappearing scrollbars, zoom to text, etc. because those are handled in the application interface and probably rely on frameworks only available in the developer preview version of Lion. As far as I can tell, downloading a nightly binary is the same as building it from source, but this is just for those who want to do it anyway.
1.) Download the standard webkit nightly build as an application. (you can stop here, or go on to build from source and we’ll use this application to run the compiled result)
2.) Run this in terminal, or use an SVN client. “svn checkout http://svn.webkit.org/repository/webkit/trunk WebKit”
3.) Run the “build-webkit” script, which builds webkit2 by default: “./WebKit/Tools/Scripts/build-webkit” —This takes a while
4.) Make an Automator action, choose “run shell script”, paste this code, and save as an application: “
#!/bin/sh
~/webkit2/WebKit/Tools/Scripts/run-webkit-app /Applications/Webkit.app
exit 0
5.) Enjoy the fruits of your compute cycles. You can verify it worked by checking your user agent string at a site like http://whatismyuseragent.dotdoh.com/