Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Feasible to build your own WebKit-based UIWebView for iOS?

Apple has (partly) open sourced the WebKit and JavaScriptCore engine they use in iOS: http://www.opensource.apple.com/release/ios-433/

It is already possible to build, use, and ship your own version of JavaScriptCore on iOS. Is it, however, possible to do the same with the rendering engine of WebKit? The UIWebView on iOS is very limited. The vital feature it is missing is accessing the JavaScriptCore JavaScript context object. Without it, it's close to impossible to run some code directly in JavaScriptCore and some code in the web view while sharing the same JS engine. So I'm interested in building my own WebKit-based web view that exposes the JavaScript context.

Are there any projects that have done any work in this regard yet? Would the compiled web view library be far too big to ship with an app?

Thanks!

like image 443
Johannes Fahrenkrug Avatar asked Jul 28 '11 11:07

Johannes Fahrenkrug


2 Answers

It is possible, but not allowed by Apple. For the same official reasons that they did not allow Google to ship their own WebKit version with their browser. Google has to use UIWebView.

like image 30
daniel.gindi Avatar answered Sep 21 '22 12:09

daniel.gindi


This is very feasible. In fact, it has already been done. Impact is an iOS game engine that compiles its own JavaScript core. Here's a blog post with some technical details.

I won't elaborate further here, the links should provide more than enough detail.

like image 176
August Lilleaas Avatar answered Sep 22 '22 12:09

August Lilleaas