3 ms·
Does WKWebView work with file:/// urls needed by Cordova?
by 0x0 11y ago
Does WKWebView work with file:/// urls needed by Cordova?
- gpmcadam 11y agoIs there a reason they don't ship with a simple web server to server out the static files, similar to `python -m SimpleHTTPServer`?
- eddieroger 11y agoWhy would they want to? Both platforms have webviews that can render HTML from a file, or passed in strong form, or whatever you like. Why point it at an internal web server? If anything, it'd add overhead to the system that's unnecessary.
- 0x0 11y agoApparently WKWebView does not support loading from file. That's why he suggested wrapping it in a localhost HTTP server.
- Spoom 11y agoThe Android Cordova platform used to do this by including OkHttp but they moved away from that because it's now unnecessary.
- RoboSeldon 11y agoLast time I checked (a few months ago) you couldn't use file:/// with a WKWebView at least on iOS8. Apparently, latest iOS9 beta allows you to load a local file.
- windsurfer 11y agoNo, but there is a drop-in plugin that adds a webserver and converts your webview to WKWebView: https://github.com/Telerik-Verified-Plugins/WKWebView https://github.com/Telerik-Verified-Plugins/WKWebView It has a few limitations, but it's quite nice for games.
- o_____________o 11y agoCheck out https://github.com/Telerik-Verified-Plugins/WKWebView https://github.com/Telerik-Verified-Plugins/WKWebView