LDK
LDK

Reputation: 2575

Using WebKit.framework from WebKit nightly in Cocoa app?

I'm currently using WebView in a Cocoa app, I'd also like to use the HTML5 File API, within webview (specifically FileReader). FileReader is not supported in the latest version of WebKit, but it is supported in WebKit nightly. How would I go about using the WebKit.framework from webkit nightly for my app?

I've tried: 1. installing webkit nightly and adding the WebKit.framework within WebKit.app to my cocoa app, that did not enable FileReader... 2. Changing the import statement to point to the WebKit.framework within WebKit.app... that did not work either.

Upvotes: 3

Views: 1051

Answers (1)

Rob Keniger
Rob Keniger

Reputation: 46020

If you mount the WebKit nightly build disk image, you can temporarily tell your app to use that library instead of the built-in WebKit by setting this environment variable:

DYLD_FRAMEWORK_PATH=/Volumes/WebKit/WebKit.app/Contents/Frameworks/10.9

To set this in Xcode 4, click on the Scheme popup and choose Edit Scheme. Next, click the Arguments tab and add a new environment variable, with the name DYLD_FRAMEWORK_PATH and the value /Volumes/WebKit/WebKit.app/Contents/Frameworks/10.9.

Note that this is for development only, and will not work for end users.

It is generally a really bad idea to use a custom version of WebKit in a shipping app, but if you absolutely must ship a development version of WebKit to your users, you should build it from source and link directly to that code. You would probably need to build WebCore as well. Yay, fun times! :-/

Upvotes: 3

Related Questions