• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
WKWebView loading local files (and relative paths)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: WKWebView loading local files (and relative paths)
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: CMFormatDescriptionEqual
  • Next by Date: Re: WKWebView loading local files (and relative paths)
  • Previous by thread: Re: CMFormatDescriptionEqual
  • Next by thread: Re: WKWebView loading local files (and relative paths)
  • Index(es):
    • Date
    • Thread