WKWebview v3.0.0


#1

WKWebview v3.0.0 :tada:

Howdy folks!

We’ve been working on updating the wkwebview plugin to address many of the issues it has had.
The latest version, 3.0, includes a bunch of fixes regarding CORs issues, background issues, and much more.

Give it a try and let us know how it works for you!

Installation

If you already have the wkwebview plugin installed, you’ll want to remove it first.

ionic plugin rm cordova-plugin-wkwebview-engine --save

Then install the latest from master

ionic plugin install https://github.com/driftyco/cordova-plugin-wkwebview-engine --save

We’re still looking for feed back on things like remote/local audio/video, integration with custom URL schemes, and different href schemes.

If you come across any problems, please feel free to open on issue on the plugin repo.

If you want to know more about the WKWebView plugin and its benefits, please read our previous blog: http://blog.ionic.io/cordova-ios-performance-improvements-drop-in-speed-with-wkwebview/


WKWebView to become the default webview for Ionic on iOS
#2

#3

@mhartington, Does not install. No errors. config.xml is not updated. Any advices?

$ ionic plugin install https://github.com/driftyco/cordova-plugin-wkwebview-engine --save
cordova-plugin-app-update 1.3.9 "AppUpdate"
cordova-plugin-appversion 1.0.0 "App Version"
cordova-plugin-console 1.0.6 "Console"
cordova-plugin-device 1.1.5 "Device"
cordova-plugin-facebook4 1.7.4 "Facebook Connect"
cordova-plugin-firebase 0.1.19 "Google Firebase Plugin"
cordova-plugin-google-analytics 1.7.5 "Google Universal Analytics Plugin"
cordova-plugin-googleplus 5.1.1 "Google SignIn"
cordova-plugin-inapppurchase 1.1.0 "In App Purchase"
cordova-plugin-splashscreen 4.0.2 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
ionic-plugin-deeplinks 1.0.14 "Ionic Deeplink Plugin"
ionic-plugin-deploy 0.6.5 "IonicDeploy"
ionic-plugin-keyboard 2.2.1 "Keyboard"

#4

Installed after removing/adding iOS platform.


#5

In another release there was a change in what you have to put in your config.xml. Did you update the value of <allow-navigation>?

<allow-navigation href="http://localhost:8080/*" />

Edit: It’s working on all my iOS devices now.

The only little thing I’d like to have would be not having to set up those Safari specific CORS headers in our web servers. But anyway, that’s currently the only little drawback we have to deal with. On the other hand it solves many issues, especially layout things and it’s much faster, that’s amazing and totally worth it :slight_smile:.


#6

Does this version support local xhr?


#7

yes! it does support local XHR


#8

Installed the plugin. The quick feedback is great work!!! it seems like many issues were solved over what we had in version WKWebview v2.
One feedback: when running the project from Xcode on iPhone the Safari developer tools keeps showing up in some strange way even though I didn’t even inspected the app with Safari.


#9

Showing keyboard upon input focus still not working. Any way to workaround it?


#10

Maybe you’ve checked Develop => Device-Name => Automatically Show Web Inspector for JSContexts in Safari previously?

I did that in the past but the old UIWebView never triggered anything ;).


#11

True. Unchecking it solves the issue. Thanks.


#12

Scroll doesn’t work as good as it does with the old view. There are more accidental clicks that leads to navigating to next page when trying to scroll up and down. Sometimes the scroll is freezing for a sec or two.

I’m using Ionic 1.3.2 BTW.


#13

@yosikal could you put together a simple minimal project to look at? There’s probably some logic that is getting messed up in V1 when it tries to figure out how to handle clicks/taps correctly.


#14

Added the plugin to my project, working great so far! :slight_smile:

Edit: Crashing after a few mins now :frowning:


#15

What version of ionic are you using?


#16

Cordova CLI: 5.3.3
Ionic Framework Version: 2.0.1
Ionic CLI Version: 2.2.0
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: macOS Sierra
Node Version: v6.2.0
Xcode version: Xcode 8.2.1 Build version 8C1002


#17

Could you run ionic platform ls? The CLI version looks a little old so you might have an older version of cordova-ios


#18

Gave it a try today… we would love to see this plugin work.

2 issues so far on our side

  • cordova-plugin-image-picker 1.1.1 fails to output images with file://
  • for authentication we use Auth0 with a custom interface and WKWebview breaks the authentication in the inappbrowser (not sure why)

System info:
Cordova CLI: 6.5.0
Ionic Framework Version: 1.3.1
Ionic CLI Version: 2.0.0
Ionic App Lib Version: 2.0.0-beta.20
ios-deploy version: 1.9.1
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v4.4.7
Xcode version: Xcode 8.2 Build version 8C38


#19

So file:// not working has always been a case for wkwebview and there’s not really much we can do about that.
What you can do though is to remove the file:// prefix and that should work.

As for the Auth0 issue, we’ll have to look into this more. Could you open an issue on github in the meantime?


WKWebview and "file://" - doesn't work even after removing file://
#20

thanks… I will run the plugin again tomorrow and gather some more debug info before posting it on github