i have a web browser app for macOS
ChatGPT site would load but none of the buttons on the website are clickable. It’s completely random, it would work when i restart the app but it goes back to not working. I don’t have this issue with safari.
class NavigationState : NSObject, ObservableObject, WKNavigationDelegate {
.....
@discardableResult func createNewWebView(withRequest request: URLRequest) -> WKWebView {
let configuration = WKWebViewConfiguration()
let preferences = WKPreferences()
preferences.javaScriptEnabled = true
configuration.preferences = preferences
configuration.websiteDataStore = WKWebsiteDataStore.nonPersistent()
let webView = WKWebView(frame: .zero, configuration: configuration)
webView.uiDelegate = self
webView.navigationDelegate = self
webView.allowsBackForwardNavigationGestures = true
webView.autoresizingMask = [.width, .height]
webView.translatesAutoresizingMaskIntoConstraints = true
webView.customUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 13_0) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15"
webView.load(request)
selectedWebView = webView
return webView
}
......
}