Can WKWebView load local resources now?

I see that WKWebView has been fixed to allow loading file:// URLs.


Does anybody know if it can now also load other local resources (e.g. custom fonts)? That used to work with UIWebView.

Replies

Please somebody reply to this question, I am also encoutering the same problem to load the local resources.


The following is the error recevied from the delegate when try to load the local resources:


didFailProvisionalNavigation to request:<WKNavigation: 0x12e37b580>, error: Error Domain=kCFErrorDomainCFNetwork Code=1 "(null)" UserInfo={NSErrorFailingURLKey=file:///var/mobile/Containers/Data/Application/.....



What I did for temporary fix the problem, is to copy everything to the tmp/ directory and load from tmp directory path.

Would like to know this also. I'm getting the same `kCFErrorDomainCFNetwork Code=1` error in `didFailProvisionalNavigation` for some local file loads, but having trouble understanding why.


The user has opened the file via a NSOpenSave panel on macOS, and `startAccessingSecurityScopedResource()` has been called. The html file doesn't load any external css/js files.


Edit: I've found out that this is a bug. See http://www.openradar.me/45346962 for details.

I am facing similar issue with my app, when two e LoadRequest using WKWebview is made one after another. 2nd LoadRequest executed whiel reloading the app on a button click for refresh.