WKWebView Evaluate Javascript without reloading page
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Currently I can only figure out how to evaluate javascript by adding it to the webview's configuration's userContentController and reloading the page like so: WKUserScript * script = [[ WKUserScript alloc ] initWithSource : source injectionTime : WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly : YES ]; [ self . webView . configuration . userContentController addUserScript : script ]; [ self . webView reload ]; How can I execute javascript on my WKWebView similarly to the old WebView's stringByEvaluatingJavaScriptFromString: