cross origin requests are only supported for http wkwebview

Swift
webView.configuration.preferences.setValue(true, forKey: "allowFileAccessFromFileURLs")
Source

Also in Swift: