func userContentController_ userContentController WKUserContentController didReceive message WKScriptMessage if messagename == log printmessagebody
This function is the delegate method for handling messages sent from JavaScript to the WKWebView.
The function checks if the message name is "log" and then prints the body of the message. This allows you to receive and process messages sent from JavaScript within your app.
原文地址: http://www.cveoy.top/t/topic/iTnO 著作权归作者所有。请勿转载和采集!