WKWebView loading local files (and relative paths)
WKWebView loading local files (and relative paths)
- Subject: WKWebView loading local files (and relative paths)
- From: Tim Fletcher <email@hidden>
- Date: Sat, 25 Jul 2015 23:40:25 +0100
Hi All
I would like to have my application build mostly around WKWebView, with computationally hard bits (lots of CoreAudio) done in c (well, mix of Swift, C and ObjC)
However, I am not able to load files from the local file system
let url : NSURL = NSURL(fileURLWithPath: "/Users/****/main.html")!
let req: NSURLRequest = NSURLRequest(URL: url)
self.webView!.loadRequest(req)
This works fine for HTTP locations, but not local FS ones. The following StackExchange <http://stackoverflow.com/questions/27233871/wkwebview-with-local-file> question describes a similar problem. However this is a iOS related post.
The Solutions provided in those posts are to use a small embedded web server. While that would work, I think I am missing a configuration setting somewhere to allow insecure content (or something like that).
Can anyone point me in a more Cocoaic approach, or is the server the best bet?
Many thanks for your time
Tim
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden