WebView no longer loads URL

In several of my apps, I have a small window that loads Google.com when it opens. I've used the following code successfully:


import Cocoa

import WebKit


class ViewController: NSViewController {


@IBOutlet weak var myWebView: WKWebView!

override func viewDidLoad() {

super.viewDidLoad()

let myURL = URL(string:"https://www.google.com")

let myRequest = URLRequest(url: myURL!)

myWebView.load(myRequest)

}

}


Today I open one of my projects, and this code builds successfully, but the page never loads. I've not changed a single character of the code. It's been about two months since I built the project, so I suspect something has changed since then.


Has something changed in WebKit that renders this non-functional? I've scoured the Xcode release notes, forums, etc. But there is no mention of it. I'm at a loss as to what is wrong.

As far as I tried, your code works as expected with App Sandbox disabled.

Have you checked the project entitlements or other settings?

WebView no longer loads URL
 
 
Q