Shazron's Cordova (aka PhoneGap) Blog

at Adobe Systems Inc.

Archive for March 2015

WKWebView and Apache Cordova

with 18 comments

Webkit_LogoThe Good

WKWebView support will be coming in cordova-ios 4.0.0, tentatively scheduled for April 2015. You can however, alpha test the support by following this README.

Pluggable webviews are coming in cordova-ios 4.0.0, which in addition to the default UIWebView, you can include the wkwebview-engine plugin for WKWebView support (it will not be in there by default so as not to break your existing code). The default uiwebview-engine has also been pluginized as well, which allows scenarios where you can update it with bug fixes after a platform release, or substituting it as the default webview for wkwebview-engine in the future.

cordova-ios 4.0.0 is still a work in a progress, and the APIs are subject to change. Rest assured that all core plugins will be compatible before we release, and we’ll test a bunch of the top plugins from plugins.cordova.io as well.

The Bad

Unfortunately for the WKWebView in iOS 8, support for loading local files in the app bundle is not available (yet). The code has been patched in WebKit2, but the patch hasn’t been downstreamed into iOS yet. As of iOS 8.3 beta 2, the functionality is still not available. So, we’ve decide to use the embedded local web-server route. Because of this, the File core plugin and the Camera core plugin might not work yet (fixes are coming) — we have a solution that transforms file:/// references to the appropriate http://localhost routes.

The Ugly

So WKWebView is great right? Yup! But there are limitations to its behaviour as compared to UIWebView:

Help Test!

Instructions here. Please file issues and assign them to me. Thanks everyone 🙂

Advertisements

Written by shazron

March 3, 2015 at 1:48 am

Posted in Uncategorized

%d bloggers like this: