2

I am trying to load printable html content in WKWebView, but I get the following errors on MacOS Mojave. Here's the output:

[default] Unable to load Info.plist exceptions (eGPUOverrides)

RETURNING UnknownFS PLACEHOLDER: 33D3E944-F72B-32A1-A693-5179CF9A6BEF

errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}

Here is my code and I don't know why the view can't web view can't even the load the html content which is passed from a segue. Please what am I doing wrong?

class PrintPreviewVC: NSViewController,  WKUIDelegate, WKScriptMessageHandler {

var vc: DownloadDataVC!
var htmlContent: String = ""
var currentOrientation = "portrait"

var webView: WKWebView!

override func loadView() {
    let webConfiguration = WKWebViewConfiguration()
    let script = WKUserScript(source: "window.print = function() { window.webkit.messageHandlers.print.postMessage('print') }", injectionTime: WKUserScriptInjectionTime.atDocumentEnd, forMainFrameOnly: true)
    webConfiguration.userContentController.addUserScript(script)
    webConfiguration.userContentController.add(self, name: "print")
    webView = WKWebView(frame: .zero, configuration: webConfiguration)
    webView.uiDelegate = self
    view = webView
}
override func viewDidLoad() {
    super.viewDidLoad()


    webView.loadHTMLString(htmlContent, baseURL: nil)
}

func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
    if message.name == "print" {
        printCurrentPage()
    } else {
        print("Some other message sent from web page...")
    }
}

func printCurrentPage() {
    print("content printed")
}
}
Suh Fangmbeng
  • 573
  • 4
  • 16
  • Possible duplicate of [Unable to load Info.plist error Xcode 10 under macOS 10.14 Mojave](https://stackoverflow.com/questions/52507950/unable-to-load-info-plist-error-xcode-10-under-macos-10-14-mojave) – BB9z Jan 22 '19 at 13:14

0 Answers0