From 530ab952ac548c255f0ba700b8f76cacc40e6eb7 Mon Sep 17 00:00:00 2001 From: Sander Hautvast Date: Wed, 21 Feb 2024 14:05:44 +0100 Subject: [PATCH] Update WKWebView_logging.md --- IOS/WKWebView_logging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IOS/WKWebView_logging.md b/IOS/WKWebView_logging.md index 2f48b26..e5596b0 100644 --- a/IOS/WKWebView_logging.md +++ b/IOS/WKWebView_logging.md @@ -26,7 +26,7 @@ struct WebView: UIViewRepresentable { let source = "function captureLog(msg) { window.webkit.messageHandlers.logHandler.postMessage(msg); } window.console.log = captureLog;" let script = WKUserScript(source: source, injectionTime: .atDocumentEnd, forMainFrameOnly: false) webView.configuration.userContentController.addUserScript(script) - // register the bridge script that listens for the output + webView.configuration.userContentController.add(Controller(), name: "logHandler") return webView